Skip to content

Commit e0276f0

Browse files
committed
small optimizations in default config
1 parent ec65b84 commit e0276f0

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/config/default-config.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const OVERFLOW = ['auto', 'hidden', 'visible', 'scroll'] as const
77
const LENGTH = [isLength] as const
88
const LENGTH_WITH_AUTO = ['auto', isLength] as const
99
const INTEGER = [isInteger] as const
10+
const INTEGER_WITH_AUTO = ['auto', isInteger] as const
1011
const ANY = [isAny] as const
1112
const POSITIONS = [
1213
'bottom',
@@ -43,6 +44,7 @@ const BLEND_MODES = [
4344
],
4445
},
4546
] as const
47+
const ALIGN = ['start', 'end', 'center', 'between', 'around', 'evenly'] as const
4648

4749
export function getDefaultConfig() {
4850
return {
@@ -281,12 +283,12 @@ export function getDefaultConfig() {
281283
* Grid Column Start
282284
* @see https://tailwindcss.com/docs/grid-column
283285
*/
284-
[{ start: ['auto', isInteger] }],
286+
[{ start: INTEGER_WITH_AUTO }],
285287
/**
286288
* Grid Column End
287289
* @see https://tailwindcss.com/docs/grid-column
288290
*/
289-
[{ end: ['auto', isInteger] }],
291+
[{ end: INTEGER_WITH_AUTO }],
290292
],
291293
row: [
292294
/**
@@ -298,12 +300,12 @@ export function getDefaultConfig() {
298300
* Grid Row Start
299301
* @see https://tailwindcss.com/docs/grid-row
300302
*/
301-
[{ start: ['auto', isInteger] }],
303+
[{ start: INTEGER_WITH_AUTO }],
302304
/**
303305
* Grid Row End
304306
* @see https://tailwindcss.com/docs/grid-row
305307
*/
306-
[{ end: ['auto', isInteger] }],
308+
[{ end: INTEGER_WITH_AUTO }],
307309
],
308310
auto: [
309311
/**
@@ -339,7 +341,7 @@ export function getDefaultConfig() {
339341
* Justify Content
340342
* @see https://tailwindcss.com/docs/justify-content
341343
*/
342-
['start', 'end', 'center', 'between', 'around', 'evenly'],
344+
ALIGN,
343345
/**
344346
* Justify Items
345347
* @see https://tailwindcss.com/docs/justify-items
@@ -356,7 +358,7 @@ export function getDefaultConfig() {
356358
* Align Content
357359
* @see https://tailwindcss.com/docs/align-content
358360
*/
359-
['center', 'start', 'end', 'between', 'around', 'evenly'],
361+
ALIGN,
360362
/**
361363
* Content
362364
* @see https://tailwindcss.com/docs/just-in-time-mode#content-utilities
@@ -382,7 +384,7 @@ export function getDefaultConfig() {
382384
* Place Content
383385
* @see https://tailwindcss.com/docs/place-content
384386
*/
385-
[{ content: ['center', 'start', 'end', 'between', 'around', 'evenly', 'stretch'] }],
387+
[{ content: [...ALIGN, 'stretch'] }],
386388
/**
387389
* Place Items
388390
* @see https://tailwindcss.com/docs/place-items
@@ -559,14 +561,14 @@ export function getDefaultConfig() {
559561
* Max-Height
560562
* @see https://tailwindcss.com/docs/max-height
561563
*/
562-
[{ h: ['full', 'screen', isLength] }],
564+
[{ h: LENGTH }],
563565
],
564566
h: [
565567
/**
566568
* Height
567569
* @see https://tailwindcss.com/docs/height
568570
*/
569-
['auto', isLength],
571+
LENGTH_WITH_AUTO,
570572
],
571573
// Typography
572574
font: [

0 commit comments

Comments
 (0)