Skip to content

Commit 0cb043f

Browse files
committed
hoist default spacing suggestions
1 parent b991d14 commit 0cb043f

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

packages/tailwindcss/src/utilities.ts

+38-38
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,43 @@ import * as ValueParser from './value-parser'
2929
const IS_VALID_STATIC_UTILITY_NAME = /^-?[a-z][a-zA-Z0-9/%._-]*$/
3030
const IS_VALID_FUNCTIONAL_UTILITY_NAME = /^-?[a-z][a-zA-Z0-9/%._-]*-\*$/
3131

32+
const DEFAULT_SPACING_SUGGESTIONS = [
33+
'0',
34+
'0.5',
35+
'1',
36+
'1.5',
37+
'2',
38+
'2.5',
39+
'3',
40+
'3.5',
41+
'4',
42+
'5',
43+
'6',
44+
'7',
45+
'8',
46+
'9',
47+
'10',
48+
'11',
49+
'12',
50+
'14',
51+
'16',
52+
'20',
53+
'24',
54+
'28',
55+
'32',
56+
'36',
57+
'40',
58+
'44',
59+
'48',
60+
'52',
61+
'56',
62+
'60',
63+
'64',
64+
'72',
65+
'80',
66+
'96',
67+
]
68+
3269
type CompileFn<T extends Candidate['kind']> = (
3370
value: Extract<Candidate, { kind: T }>,
3471
) => AstNode[] | undefined | null
@@ -476,44 +513,7 @@ export function createUtilities(theme: Theme) {
476513

477514
suggest(name, () => [
478515
{
479-
values: theme.get(['--spacing'])
480-
? [
481-
'0',
482-
'0.5',
483-
'1',
484-
'1.5',
485-
'2',
486-
'2.5',
487-
'3',
488-
'3.5',
489-
'4',
490-
'5',
491-
'6',
492-
'7',
493-
'8',
494-
'9',
495-
'10',
496-
'11',
497-
'12',
498-
'14',
499-
'16',
500-
'20',
501-
'24',
502-
'28',
503-
'32',
504-
'36',
505-
'40',
506-
'44',
507-
'48',
508-
'52',
509-
'56',
510-
'60',
511-
'64',
512-
'72',
513-
'80',
514-
'96',
515-
]
516-
: [],
516+
values: theme.get(['--spacing']) ? DEFAULT_SPACING_SUGGESTIONS : [],
517517
supportsNegative,
518518
supportsFractions,
519519
valueThemeKeys: themeKeys,

0 commit comments

Comments
 (0)