tailwindcss 0.0.0-insiders.fe08e91 → 0.0.0-oxide.dd87d75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +379 -3
- package/LICENSE +1 -2
- package/README.md +12 -8
- package/colors.d.ts +3 -0
- package/defaultConfig.d.ts +3 -0
- package/defaultTheme.d.ts +4 -0
- package/lib/cli/build/deps.js +54 -0
- package/lib/cli/build/index.js +48 -0
- package/lib/cli/build/plugin.js +367 -0
- package/lib/cli/build/utils.js +78 -0
- package/lib/cli/build/watching.js +178 -0
- package/lib/cli/help/index.js +71 -0
- package/lib/cli/index.js +239 -0
- package/lib/cli/init/index.js +46 -0
- package/lib/cli/shared.js +13 -0
- package/lib/cli-peer-dependencies.js +20 -7
- package/lib/cli.js +4 -740
- package/lib/constants.js +27 -20
- package/lib/corePluginList.js +6 -3
- package/lib/corePlugins.js +2064 -1811
- package/lib/css/preflight.css +5 -5
- package/lib/featureFlags.js +31 -22
- package/lib/index.js +4 -28
- package/lib/lib/cacheInvalidation.js +90 -0
- package/lib/lib/collapseAdjacentRules.js +27 -9
- package/lib/lib/collapseDuplicateDeclarations.js +12 -9
- package/lib/lib/content.js +176 -0
- package/lib/lib/defaultExtractor.js +225 -31
- package/lib/lib/detectNesting.js +13 -10
- package/lib/lib/evaluateTailwindFunctions.js +118 -55
- package/lib/lib/expandApplyAtRules.js +439 -190
- package/lib/lib/expandTailwindAtRules.js +151 -134
- package/lib/lib/findAtConfigPath.js +44 -0
- package/lib/lib/generateRules.js +454 -187
- package/lib/lib/getModuleDependencies.js +11 -8
- package/lib/lib/normalizeTailwindDirectives.js +36 -32
- package/lib/lib/offsets.js +217 -0
- package/lib/lib/partitionApplyAtRules.js +56 -0
- package/lib/lib/regex.js +60 -0
- package/lib/lib/resolveDefaultsAtRules.js +89 -67
- package/lib/lib/setupContextUtils.js +667 -376
- package/lib/lib/setupTrackingContext.js +38 -67
- package/lib/lib/sharedState.js +27 -14
- package/lib/lib/substituteScreenAtRules.js +11 -9
- package/lib/plugin.js +48 -0
- package/{nesting → lib/postcss-plugins/nesting}/README.md +2 -2
- package/lib/postcss-plugins/nesting/index.js +19 -0
- package/lib/postcss-plugins/nesting/plugin.js +87 -0
- package/lib/processTailwindFeatures.js +35 -25
- package/lib/public/colors.js +247 -245
- package/lib/public/create-plugin.js +6 -4
- package/lib/public/default-config.js +7 -5
- package/lib/public/default-theme.js +7 -5
- package/lib/public/resolve-config.js +8 -5
- package/lib/util/bigSign.js +4 -1
- package/lib/util/buildMediaQuery.js +11 -6
- package/lib/util/cloneDeep.js +7 -6
- package/lib/util/cloneNodes.js +21 -3
- package/lib/util/color.js +53 -54
- package/lib/util/configurePlugins.js +5 -2
- package/lib/util/createPlugin.js +6 -6
- package/lib/util/createUtilityPlugin.js +12 -14
- package/lib/util/dataTypes.js +119 -110
- package/lib/util/defaults.js +4 -1
- package/lib/util/escapeClassName.js +7 -4
- package/lib/util/escapeCommas.js +5 -2
- package/lib/util/flattenColorPalette.js +9 -12
- package/lib/util/formatVariantSelector.js +184 -85
- package/lib/util/getAllConfigs.js +27 -8
- package/lib/util/hashConfig.js +6 -3
- package/lib/util/isKeyframeRule.js +5 -2
- package/lib/util/isPlainObject.js +5 -2
- package/lib/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +23 -15
- package/lib/util/log.js +20 -14
- package/lib/util/nameClass.js +20 -9
- package/lib/util/negateValue.js +23 -8
- package/lib/util/normalizeConfig.js +116 -72
- package/lib/util/normalizeScreens.js +120 -11
- package/lib/util/parseAnimationValue.js +42 -40
- package/lib/util/parseBoxShadowValue.js +30 -23
- package/lib/util/parseDependency.js +38 -56
- package/lib/util/parseGlob.js +34 -0
- package/lib/util/parseObjectStyles.js +11 -8
- package/lib/util/pluginUtils.js +147 -50
- package/lib/util/prefixSelector.js +10 -8
- package/lib/util/removeAlphaVariables.js +29 -0
- package/lib/util/resolveConfig.js +97 -85
- package/lib/util/resolveConfigPath.js +11 -9
- package/lib/util/responsive.js +8 -5
- package/lib/util/splitAtTopLevelOnly.js +43 -0
- package/lib/util/tap.js +4 -1
- package/lib/util/toColorValue.js +5 -3
- package/lib/util/toPath.js +20 -4
- package/lib/util/transformThemeValue.js +37 -29
- package/lib/util/validateConfig.js +24 -0
- package/lib/util/validateFormalSyntax.js +24 -0
- package/lib/util/withAlphaVariable.js +23 -15
- package/nesting/index.js +2 -12
- package/package.json +47 -42
- package/peers/index.js +11381 -7950
- package/plugin.d.ts +11 -0
- package/resolveConfig.d.ts +12 -0
- package/scripts/generate-types.js +105 -0
- package/scripts/release-channel.js +18 -0
- package/scripts/release-notes.js +21 -0
- package/scripts/type-utils.js +27 -0
- package/src/cli/build/deps.js +56 -0
- package/src/cli/build/index.js +49 -0
- package/src/cli/build/plugin.js +439 -0
- package/src/cli/build/utils.js +76 -0
- package/src/cli/build/watching.js +227 -0
- package/src/cli/help/index.js +70 -0
- package/src/cli/index.js +234 -0
- package/src/cli/init/index.js +50 -0
- package/src/cli/shared.js +6 -0
- package/src/cli-peer-dependencies.js +7 -1
- package/src/cli.js +4 -810
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +532 -217
- package/src/css/preflight.css +5 -5
- package/src/featureFlags.js +15 -9
- package/src/index.js +4 -27
- package/src/lib/cacheInvalidation.js +52 -0
- package/src/lib/collapseAdjacentRules.js +21 -2
- package/src/lib/content.js +212 -0
- package/src/lib/defaultExtractor.js +196 -33
- package/src/lib/evaluateTailwindFunctions.js +78 -7
- package/src/lib/expandApplyAtRules.js +482 -183
- package/src/lib/expandTailwindAtRules.js +106 -85
- package/src/lib/findAtConfigPath.js +48 -0
- package/src/lib/generateRules.js +418 -129
- package/src/lib/normalizeTailwindDirectives.js +1 -0
- package/src/lib/offsets.js +270 -0
- package/src/lib/partitionApplyAtRules.js +52 -0
- package/src/lib/regex.js +74 -0
- package/src/lib/resolveDefaultsAtRules.js +51 -30
- package/src/lib/setupContextUtils.js +556 -208
- package/src/lib/setupTrackingContext.js +11 -48
- package/src/lib/sharedState.js +5 -0
- package/src/plugin.js +47 -0
- package/src/postcss-plugins/nesting/README.md +42 -0
- package/src/postcss-plugins/nesting/index.js +13 -0
- package/src/postcss-plugins/nesting/plugin.js +80 -0
- package/src/processTailwindFeatures.js +8 -0
- package/src/util/buildMediaQuery.js +5 -3
- package/src/util/cloneNodes.js +19 -2
- package/src/util/color.js +25 -21
- package/src/util/dataTypes.js +29 -21
- package/src/util/formatVariantSelector.js +184 -61
- package/src/util/getAllConfigs.js +19 -0
- package/src/util/{isValidArbitraryValue.js → isSyntacticallyValidPropertyValue.js} +1 -1
- package/src/util/log.js +8 -8
- package/src/util/nameClass.js +4 -0
- package/src/util/negateValue.js +11 -3
- package/src/util/normalizeConfig.js +44 -6
- package/src/util/normalizeScreens.js +99 -4
- package/src/util/parseBoxShadowValue.js +4 -3
- package/src/util/parseDependency.js +37 -42
- package/src/util/parseGlob.js +24 -0
- package/src/util/pluginUtils.js +132 -10
- package/src/util/prefixSelector.js +7 -5
- package/src/util/removeAlphaVariables.js +24 -0
- package/src/util/resolveConfig.js +70 -32
- package/src/util/splitAtTopLevelOnly.js +45 -0
- package/src/util/toPath.js +1 -1
- package/src/util/transformThemeValue.js +13 -3
- package/src/util/validateConfig.js +13 -0
- package/src/util/validateFormalSyntax.js +34 -0
- package/src/util/withAlphaVariable.js +1 -1
- package/stubs/defaultConfig.stub.js +23 -20
- package/stubs/simpleConfig.stub.js +1 -0
- package/types/config.d.ts +362 -0
- package/types/generated/.gitkeep +0 -0
- package/types/generated/colors.d.ts +276 -0
- package/types/generated/corePluginList.d.ts +1 -0
- package/types/generated/default-theme.d.ts +342 -0
- package/types/index.d.ts +7 -0
- package/nesting/plugin.js +0 -41
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
1
2
|
module.exports = {
|
|
2
3
|
content: [],
|
|
3
4
|
presets: [],
|
|
@@ -10,6 +11,7 @@ module.exports = {
|
|
|
10
11
|
xl: '1280px',
|
|
11
12
|
'2xl': '1536px',
|
|
12
13
|
},
|
|
14
|
+
supports: {},
|
|
13
15
|
colors: ({ colors }) => ({
|
|
14
16
|
inherit: colors.inherit,
|
|
15
17
|
current: colors.current,
|
|
@@ -111,6 +113,16 @@ module.exports = {
|
|
|
111
113
|
pulse: 'pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite',
|
|
112
114
|
bounce: 'bounce 1s infinite',
|
|
113
115
|
},
|
|
116
|
+
aria: {
|
|
117
|
+
checked: 'checked="true"',
|
|
118
|
+
disabled: 'disabled="true"',
|
|
119
|
+
expanded: 'expanded="true"',
|
|
120
|
+
hidden: 'hidden="true"',
|
|
121
|
+
pressed: 'pressed="true"',
|
|
122
|
+
readonly: 'readonly="true"',
|
|
123
|
+
required: 'required="true"',
|
|
124
|
+
selected: 'selected="true"',
|
|
125
|
+
},
|
|
114
126
|
aspectRatio: {
|
|
115
127
|
auto: 'auto',
|
|
116
128
|
square: '1 / 1',
|
|
@@ -194,6 +206,9 @@ module.exports = {
|
|
|
194
206
|
'3xl': '1.5rem',
|
|
195
207
|
full: '9999px',
|
|
196
208
|
},
|
|
209
|
+
borderSpacing: ({ theme }) => ({
|
|
210
|
+
...theme('spacing'),
|
|
211
|
+
}),
|
|
197
212
|
borderWidth: {
|
|
198
213
|
DEFAULT: '1px',
|
|
199
214
|
0: '0px',
|
|
@@ -280,7 +295,10 @@ module.exports = {
|
|
|
280
295
|
'2xl': '0 25px 25px rgb(0 0 0 / 0.15)',
|
|
281
296
|
none: '0 0 #0000',
|
|
282
297
|
},
|
|
283
|
-
fill: ({ theme }) =>
|
|
298
|
+
fill: ({ theme }) => ({
|
|
299
|
+
none: 'none',
|
|
300
|
+
...theme('colors'),
|
|
301
|
+
}),
|
|
284
302
|
grayscale: {
|
|
285
303
|
0: '0',
|
|
286
304
|
DEFAULT: '100%',
|
|
@@ -789,7 +807,10 @@ module.exports = {
|
|
|
789
807
|
space: ({ theme }) => ({
|
|
790
808
|
...theme('spacing'),
|
|
791
809
|
}),
|
|
792
|
-
stroke: ({ theme }) =>
|
|
810
|
+
stroke: ({ theme }) => ({
|
|
811
|
+
none: 'none',
|
|
812
|
+
...theme('colors'),
|
|
813
|
+
}),
|
|
793
814
|
strokeWidth: {
|
|
794
815
|
0: '0',
|
|
795
816
|
1: '1',
|
|
@@ -928,23 +949,5 @@ module.exports = {
|
|
|
928
949
|
50: '50',
|
|
929
950
|
},
|
|
930
951
|
},
|
|
931
|
-
variantOrder: [
|
|
932
|
-
'first',
|
|
933
|
-
'last',
|
|
934
|
-
'odd',
|
|
935
|
-
'even',
|
|
936
|
-
'visited',
|
|
937
|
-
'checked',
|
|
938
|
-
'empty',
|
|
939
|
-
'read-only',
|
|
940
|
-
'group-hover',
|
|
941
|
-
'group-focus',
|
|
942
|
-
'focus-within',
|
|
943
|
-
'hover',
|
|
944
|
-
'focus',
|
|
945
|
-
'focus-visible',
|
|
946
|
-
'active',
|
|
947
|
-
'disabled',
|
|
948
|
-
],
|
|
949
952
|
plugins: [],
|
|
950
953
|
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import type { CorePluginList } from './generated/corePluginList'
|
|
2
|
+
import type { DefaultColors } from './generated/colors'
|
|
3
|
+
|
|
4
|
+
// Helpers
|
|
5
|
+
type Expand<T> = T extends object
|
|
6
|
+
? T extends infer O
|
|
7
|
+
? { [K in keyof O]: Expand<O[K]> }
|
|
8
|
+
: never
|
|
9
|
+
: T
|
|
10
|
+
type KeyValuePair<K extends keyof any = string, V = string> = Record<K, V>
|
|
11
|
+
interface RecursiveKeyValuePair<K extends keyof any = string, V = string> {
|
|
12
|
+
[key: string]: V | RecursiveKeyValuePair<K, V>
|
|
13
|
+
}
|
|
14
|
+
export type ResolvableTo<T> = T | ((utils: PluginUtils) => T)
|
|
15
|
+
type CSSRuleObject = RecursiveKeyValuePair<string, null | string | string[]>
|
|
16
|
+
|
|
17
|
+
interface PluginUtils {
|
|
18
|
+
colors: DefaultColors
|
|
19
|
+
theme(path: string, defaultValue?: unknown): any
|
|
20
|
+
breakpoints<I = Record<string, unknown>, O = I>(arg: I): O
|
|
21
|
+
rgb(arg: string): (arg: Partial<{ opacityVariable: string; opacityValue: number }>) => string
|
|
22
|
+
hsl(arg: string): (arg: Partial<{ opacityVariable: string; opacityValue: number }>) => string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Content related config
|
|
26
|
+
type FilePath = string
|
|
27
|
+
type RawFile = { raw: string; extension?: string }
|
|
28
|
+
type ExtractorFn = (content: string) => string[]
|
|
29
|
+
type TransformerFn = (content: string) => string
|
|
30
|
+
type ContentConfig =
|
|
31
|
+
| (FilePath | RawFile)[]
|
|
32
|
+
| {
|
|
33
|
+
files: (FilePath | RawFile)[]
|
|
34
|
+
relative?: boolean
|
|
35
|
+
extract?: ExtractorFn | { [extension: string]: ExtractorFn }
|
|
36
|
+
transform?: TransformerFn | { [extension: string]: TransformerFn }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Important related config
|
|
40
|
+
type ImportantConfig = boolean | string
|
|
41
|
+
|
|
42
|
+
// Prefix related config
|
|
43
|
+
type PrefixConfig = string
|
|
44
|
+
|
|
45
|
+
// Separator related config
|
|
46
|
+
type SeparatorConfig = string
|
|
47
|
+
|
|
48
|
+
// Safelist related config
|
|
49
|
+
type SafelistConfig =
|
|
50
|
+
| string[]
|
|
51
|
+
| {
|
|
52
|
+
pattern: RegExp
|
|
53
|
+
variants?: string[]
|
|
54
|
+
}[]
|
|
55
|
+
|
|
56
|
+
// Presets related config
|
|
57
|
+
type PresetsConfig = Config[]
|
|
58
|
+
|
|
59
|
+
// Future related config
|
|
60
|
+
type FutureConfigValues =
|
|
61
|
+
| 'hoverOnlyWhenSupported'
|
|
62
|
+
| 'respectDefaultRingColorOpacity'
|
|
63
|
+
| 'disableColorOpacityUtilitiesByDefault'
|
|
64
|
+
| 'relativeContentPathsByDefault'
|
|
65
|
+
type FutureConfig = Expand<'all' | Partial<Record<FutureConfigValues, boolean>>> | []
|
|
66
|
+
|
|
67
|
+
// Experimental related config
|
|
68
|
+
type ExperimentalConfigValues = 'optimizeUniversalDefaults' | 'matchVariant'
|
|
69
|
+
type ExperimentalConfig = Expand<'all' | Partial<Record<ExperimentalConfigValues, boolean>>> | []
|
|
70
|
+
|
|
71
|
+
// DarkMode related config
|
|
72
|
+
type DarkModeConfig =
|
|
73
|
+
// Use the `media` query strategy.
|
|
74
|
+
| 'media'
|
|
75
|
+
// Use the `class` strategy, which requires a `.dark` class on the `html`.
|
|
76
|
+
| 'class'
|
|
77
|
+
// Use the `class` strategy with a custom class instead of `.dark`.
|
|
78
|
+
| ['class', string]
|
|
79
|
+
|
|
80
|
+
type Screen = { raw: string } | { min: string } | { max: string } | { min: string; max: string }
|
|
81
|
+
type ScreensConfig = string[] | KeyValuePair<string, string | Screen | Screen[]>
|
|
82
|
+
|
|
83
|
+
// Theme related config
|
|
84
|
+
interface ThemeConfig {
|
|
85
|
+
// Responsiveness
|
|
86
|
+
screens: ResolvableTo<ScreensConfig>
|
|
87
|
+
supports: ResolvableTo<Record<string, string>>
|
|
88
|
+
|
|
89
|
+
// Reusable base configs
|
|
90
|
+
colors: ResolvableTo<RecursiveKeyValuePair>
|
|
91
|
+
spacing: ResolvableTo<KeyValuePair>
|
|
92
|
+
|
|
93
|
+
// Components
|
|
94
|
+
container: ResolvableTo<
|
|
95
|
+
Partial<{
|
|
96
|
+
screens: ScreensConfig
|
|
97
|
+
center: boolean
|
|
98
|
+
padding: string | Record<string, string>
|
|
99
|
+
}>
|
|
100
|
+
>
|
|
101
|
+
|
|
102
|
+
// Utilities
|
|
103
|
+
inset: ThemeConfig['spacing']
|
|
104
|
+
zIndex: ResolvableTo<KeyValuePair>
|
|
105
|
+
order: ResolvableTo<KeyValuePair>
|
|
106
|
+
gridColumn: ResolvableTo<KeyValuePair>
|
|
107
|
+
gridColumnStart: ResolvableTo<KeyValuePair>
|
|
108
|
+
gridColumnEnd: ResolvableTo<KeyValuePair>
|
|
109
|
+
gridRow: ResolvableTo<KeyValuePair>
|
|
110
|
+
gridRowStart: ResolvableTo<KeyValuePair>
|
|
111
|
+
gridRowEnd: ResolvableTo<KeyValuePair>
|
|
112
|
+
margin: ThemeConfig['spacing']
|
|
113
|
+
aspectRatio: ResolvableTo<KeyValuePair>
|
|
114
|
+
height: ThemeConfig['spacing']
|
|
115
|
+
maxHeight: ThemeConfig['spacing']
|
|
116
|
+
minHeight: ResolvableTo<KeyValuePair>
|
|
117
|
+
width: ThemeConfig['spacing']
|
|
118
|
+
maxWidth: ResolvableTo<KeyValuePair>
|
|
119
|
+
minWidth: ResolvableTo<KeyValuePair>
|
|
120
|
+
flex: ResolvableTo<KeyValuePair>
|
|
121
|
+
flexShrink: ResolvableTo<KeyValuePair>
|
|
122
|
+
flexGrow: ResolvableTo<KeyValuePair>
|
|
123
|
+
flexBasis: ThemeConfig['spacing']
|
|
124
|
+
borderSpacing: ThemeConfig['spacing']
|
|
125
|
+
transformOrigin: ResolvableTo<KeyValuePair>
|
|
126
|
+
translate: ThemeConfig['spacing']
|
|
127
|
+
rotate: ResolvableTo<KeyValuePair>
|
|
128
|
+
skew: ResolvableTo<KeyValuePair>
|
|
129
|
+
scale: ResolvableTo<KeyValuePair>
|
|
130
|
+
animation: ResolvableTo<KeyValuePair>
|
|
131
|
+
keyframes: ResolvableTo<KeyValuePair<string, KeyValuePair<string, KeyValuePair>>>
|
|
132
|
+
cursor: ResolvableTo<KeyValuePair>
|
|
133
|
+
scrollMargin: ThemeConfig['spacing']
|
|
134
|
+
scrollPadding: ThemeConfig['spacing']
|
|
135
|
+
listStyleType: ResolvableTo<KeyValuePair>
|
|
136
|
+
columns: ResolvableTo<KeyValuePair>
|
|
137
|
+
gridAutoColumns: ResolvableTo<KeyValuePair>
|
|
138
|
+
gridAutoRows: ResolvableTo<KeyValuePair>
|
|
139
|
+
gridTemplateColumns: ResolvableTo<KeyValuePair>
|
|
140
|
+
gridTemplateRows: ResolvableTo<KeyValuePair>
|
|
141
|
+
gap: ThemeConfig['spacing']
|
|
142
|
+
space: ThemeConfig['spacing']
|
|
143
|
+
divideWidth: ThemeConfig['borderWidth']
|
|
144
|
+
divideColor: ThemeConfig['borderColor']
|
|
145
|
+
divideOpacity: ThemeConfig['borderOpacity']
|
|
146
|
+
borderRadius: ResolvableTo<KeyValuePair>
|
|
147
|
+
borderWidth: ResolvableTo<KeyValuePair>
|
|
148
|
+
borderColor: ThemeConfig['colors']
|
|
149
|
+
borderOpacity: ThemeConfig['opacity']
|
|
150
|
+
backgroundColor: ThemeConfig['colors']
|
|
151
|
+
backgroundOpacity: ThemeConfig['opacity']
|
|
152
|
+
backgroundImage: ResolvableTo<KeyValuePair>
|
|
153
|
+
gradientColorStops: ThemeConfig['colors']
|
|
154
|
+
backgroundSize: ResolvableTo<KeyValuePair>
|
|
155
|
+
backgroundPosition: ResolvableTo<KeyValuePair>
|
|
156
|
+
fill: ThemeConfig['colors']
|
|
157
|
+
stroke: ThemeConfig['colors']
|
|
158
|
+
strokeWidth: ResolvableTo<KeyValuePair>
|
|
159
|
+
objectPosition: ResolvableTo<KeyValuePair>
|
|
160
|
+
padding: ThemeConfig['spacing']
|
|
161
|
+
textIndent: ThemeConfig['spacing']
|
|
162
|
+
fontFamily: ResolvableTo<
|
|
163
|
+
KeyValuePair<
|
|
164
|
+
string,
|
|
165
|
+
| string
|
|
166
|
+
| string[]
|
|
167
|
+
| [fontFamily: string | string[], configuration: Partial<{ fontFeatureSettings: string }>]
|
|
168
|
+
>
|
|
169
|
+
>
|
|
170
|
+
fontSize: ResolvableTo<
|
|
171
|
+
KeyValuePair<
|
|
172
|
+
string,
|
|
173
|
+
| string
|
|
174
|
+
| [fontSize: string, lineHeight: string]
|
|
175
|
+
| [
|
|
176
|
+
fontSize: string,
|
|
177
|
+
configuration: Partial<{
|
|
178
|
+
lineHeight: string
|
|
179
|
+
letterSpacing: string
|
|
180
|
+
fontWeight: string | number
|
|
181
|
+
}>
|
|
182
|
+
]
|
|
183
|
+
>
|
|
184
|
+
>
|
|
185
|
+
fontWeight: ResolvableTo<KeyValuePair>
|
|
186
|
+
lineHeight: ResolvableTo<KeyValuePair>
|
|
187
|
+
letterSpacing: ResolvableTo<KeyValuePair>
|
|
188
|
+
textColor: ThemeConfig['colors']
|
|
189
|
+
textOpacity: ThemeConfig['opacity']
|
|
190
|
+
textDecorationColor: ThemeConfig['colors']
|
|
191
|
+
textDecorationThickness: ResolvableTo<KeyValuePair>
|
|
192
|
+
textUnderlineOffset: ResolvableTo<KeyValuePair>
|
|
193
|
+
placeholderColor: ThemeConfig['colors']
|
|
194
|
+
placeholderOpacity: ThemeConfig['opacity']
|
|
195
|
+
caretColor: ThemeConfig['colors']
|
|
196
|
+
accentColor: ThemeConfig['colors']
|
|
197
|
+
opacity: ResolvableTo<KeyValuePair>
|
|
198
|
+
boxShadow: ResolvableTo<KeyValuePair>
|
|
199
|
+
boxShadowColor: ThemeConfig['colors']
|
|
200
|
+
outlineWidth: ResolvableTo<KeyValuePair>
|
|
201
|
+
outlineOffset: ResolvableTo<KeyValuePair>
|
|
202
|
+
outlineColor: ThemeConfig['colors']
|
|
203
|
+
ringWidth: ResolvableTo<KeyValuePair>
|
|
204
|
+
ringColor: ThemeConfig['colors']
|
|
205
|
+
ringOpacity: ThemeConfig['opacity']
|
|
206
|
+
ringOffsetWidth: ResolvableTo<KeyValuePair>
|
|
207
|
+
ringOffsetColor: ThemeConfig['colors']
|
|
208
|
+
blur: ResolvableTo<KeyValuePair>
|
|
209
|
+
brightness: ResolvableTo<KeyValuePair>
|
|
210
|
+
contrast: ResolvableTo<KeyValuePair>
|
|
211
|
+
dropShadow: ResolvableTo<KeyValuePair>
|
|
212
|
+
grayscale: ResolvableTo<KeyValuePair>
|
|
213
|
+
hueRotate: ResolvableTo<KeyValuePair>
|
|
214
|
+
invert: ResolvableTo<KeyValuePair>
|
|
215
|
+
saturate: ResolvableTo<KeyValuePair>
|
|
216
|
+
sepia: ResolvableTo<KeyValuePair>
|
|
217
|
+
backdropBlur: ThemeConfig['blur']
|
|
218
|
+
backdropBrightness: ThemeConfig['brightness']
|
|
219
|
+
backdropContrast: ThemeConfig['contrast']
|
|
220
|
+
backdropGrayscale: ThemeConfig['grayscale']
|
|
221
|
+
backdropHueRotate: ThemeConfig['hueRotate']
|
|
222
|
+
backdropInvert: ThemeConfig['invert']
|
|
223
|
+
backdropOpacity: ThemeConfig['opacity']
|
|
224
|
+
backdropSaturate: ThemeConfig['saturate']
|
|
225
|
+
backdropSepia: ThemeConfig['sepia']
|
|
226
|
+
transitionProperty: ResolvableTo<KeyValuePair>
|
|
227
|
+
transitionTimingFunction: ResolvableTo<KeyValuePair>
|
|
228
|
+
transitionDelay: ResolvableTo<KeyValuePair>
|
|
229
|
+
transitionDuration: ResolvableTo<KeyValuePair>
|
|
230
|
+
willChange: ResolvableTo<KeyValuePair>
|
|
231
|
+
content: ResolvableTo<KeyValuePair>
|
|
232
|
+
|
|
233
|
+
// Custom
|
|
234
|
+
[key: string]: any
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Core plugins related config
|
|
238
|
+
type CorePluginsConfig = CorePluginList[] | Expand<Partial<Record<CorePluginList, boolean>>>
|
|
239
|
+
|
|
240
|
+
// Plugins related config
|
|
241
|
+
type ValueType =
|
|
242
|
+
| 'any'
|
|
243
|
+
| 'color'
|
|
244
|
+
| 'url'
|
|
245
|
+
| 'image'
|
|
246
|
+
| 'length'
|
|
247
|
+
| 'percentage'
|
|
248
|
+
| 'position'
|
|
249
|
+
| 'lookup'
|
|
250
|
+
| 'generic-name'
|
|
251
|
+
| 'family-name'
|
|
252
|
+
| 'number'
|
|
253
|
+
| 'line-width'
|
|
254
|
+
| 'absolute-size'
|
|
255
|
+
| 'relative-size'
|
|
256
|
+
| 'shadow'
|
|
257
|
+
export interface PluginAPI {
|
|
258
|
+
// for registering new static utility styles
|
|
259
|
+
addUtilities(
|
|
260
|
+
utilities: CSSRuleObject | CSSRuleObject[],
|
|
261
|
+
options?: Partial<{
|
|
262
|
+
respectPrefix: boolean
|
|
263
|
+
respectImportant: boolean
|
|
264
|
+
}>
|
|
265
|
+
): void
|
|
266
|
+
// for registering new dynamic utility styles
|
|
267
|
+
matchUtilities<T = string, U = string>(
|
|
268
|
+
utilities: KeyValuePair<
|
|
269
|
+
string,
|
|
270
|
+
(value: T | string, extra: { modifier: U | string | null }) => CSSRuleObject | null
|
|
271
|
+
>,
|
|
272
|
+
options?: Partial<{
|
|
273
|
+
respectPrefix: boolean
|
|
274
|
+
respectImportant: boolean
|
|
275
|
+
type: ValueType | ValueType[]
|
|
276
|
+
values: KeyValuePair<string, T>
|
|
277
|
+
modifiers: 'any' | KeyValuePair<string, U>
|
|
278
|
+
supportsNegativeValues: boolean
|
|
279
|
+
}>
|
|
280
|
+
): void
|
|
281
|
+
// for registering new static component styles
|
|
282
|
+
addComponents(
|
|
283
|
+
components: CSSRuleObject | CSSRuleObject[],
|
|
284
|
+
options?: Partial<{
|
|
285
|
+
respectPrefix: boolean
|
|
286
|
+
respectImportant: boolean
|
|
287
|
+
}>
|
|
288
|
+
): void
|
|
289
|
+
// for registering new dynamic component styles
|
|
290
|
+
matchComponents<T = string, U = string>(
|
|
291
|
+
components: KeyValuePair<
|
|
292
|
+
string,
|
|
293
|
+
(value: T | string, extra: { modifier: U | string | null }) => CSSRuleObject | null
|
|
294
|
+
>,
|
|
295
|
+
options?: Partial<{
|
|
296
|
+
respectPrefix: boolean
|
|
297
|
+
respectImportant: boolean
|
|
298
|
+
type: ValueType | ValueType[]
|
|
299
|
+
values: KeyValuePair<string, T>
|
|
300
|
+
modifiers: 'any' | KeyValuePair<string, U>
|
|
301
|
+
supportsNegativeValues: boolean
|
|
302
|
+
}>
|
|
303
|
+
): void
|
|
304
|
+
// for registering new base styles
|
|
305
|
+
addBase(base: CSSRuleObject | CSSRuleObject[]): void
|
|
306
|
+
// for registering custom variants
|
|
307
|
+
addVariant(name: string, definition: string | string[] | (() => string) | (() => string)[]): void
|
|
308
|
+
matchVariant<T = string>(
|
|
309
|
+
name: string,
|
|
310
|
+
cb: (value: T | string, extra: { modifier: string | null }) => string | string[],
|
|
311
|
+
options?: {
|
|
312
|
+
values?: KeyValuePair<string, T>
|
|
313
|
+
sort?(
|
|
314
|
+
a: { value: T | string; modifier: string | null },
|
|
315
|
+
b: { value: T | string; modifier: string | null }
|
|
316
|
+
): number
|
|
317
|
+
}
|
|
318
|
+
): void
|
|
319
|
+
// for looking up values in the user’s theme configuration
|
|
320
|
+
theme: <TDefaultValue = Config['theme']>(
|
|
321
|
+
path?: string,
|
|
322
|
+
defaultValue?: TDefaultValue
|
|
323
|
+
) => TDefaultValue
|
|
324
|
+
// for looking up values in the user’s Tailwind configuration
|
|
325
|
+
config: <TDefaultValue = Config>(path?: string, defaultValue?: TDefaultValue) => TDefaultValue
|
|
326
|
+
// for checking if a core plugin is enabled
|
|
327
|
+
corePlugins(path: string): boolean
|
|
328
|
+
// for manually escaping strings meant to be used in class names
|
|
329
|
+
e: (className: string) => string
|
|
330
|
+
}
|
|
331
|
+
export type PluginCreator = (api: PluginAPI) => void
|
|
332
|
+
export type PluginsConfig = (
|
|
333
|
+
| PluginCreator
|
|
334
|
+
| { handler: PluginCreator; config?: Partial<Config> }
|
|
335
|
+
| {
|
|
336
|
+
(options: any): { handler: PluginCreator; config?: Partial<Config> }
|
|
337
|
+
__isOptionsFunction: true
|
|
338
|
+
}
|
|
339
|
+
)[]
|
|
340
|
+
|
|
341
|
+
// Top level config related
|
|
342
|
+
interface RequiredConfig {
|
|
343
|
+
content: ContentConfig
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
interface OptionalConfig {
|
|
347
|
+
important: Partial<ImportantConfig>
|
|
348
|
+
prefix: Partial<PrefixConfig>
|
|
349
|
+
separator: Partial<SeparatorConfig>
|
|
350
|
+
safelist: Partial<SafelistConfig>
|
|
351
|
+
presets: Partial<PresetsConfig>
|
|
352
|
+
future: Partial<FutureConfig>
|
|
353
|
+
experimental: Partial<ExperimentalConfig>
|
|
354
|
+
darkMode: Partial<DarkModeConfig>
|
|
355
|
+
theme: Partial<ThemeConfig & { extend: Partial<ThemeConfig> }>
|
|
356
|
+
corePlugins: Partial<CorePluginsConfig>
|
|
357
|
+
plugins: Partial<PluginsConfig>
|
|
358
|
+
// Custom
|
|
359
|
+
[key: string]: any
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export type Config = RequiredConfig & Partial<OptionalConfig>
|
|
File without changes
|