tailwindcss 0.0.0-insiders.ebc1c7a → 0.0.0-insiders.ec0049a
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/LICENSE +1 -2
- package/README.md +18 -11
- package/dist/chunk-AZANAYY2.mjs +1 -0
- package/dist/chunk-CH45MXZF.mjs +10 -0
- package/dist/chunk-V2K3XTS4.mjs +1 -0
- package/dist/colors-b_6i0Oi7.d.ts +295 -0
- package/dist/colors.d.mts +295 -0
- package/dist/colors.d.ts +5 -0
- package/dist/colors.js +1 -0
- package/dist/colors.mjs +1 -0
- package/dist/default-theme.d.mts +1147 -0
- package/dist/default-theme.d.ts +1147 -0
- package/dist/default-theme.js +1 -0
- package/dist/default-theme.mjs +1 -0
- package/dist/flatten-color-palette.d.mts +6 -0
- package/dist/flatten-color-palette.d.ts +6 -0
- package/dist/flatten-color-palette.js +1 -0
- package/dist/flatten-color-palette.mjs +1 -0
- package/dist/lib.d.mts +260 -0
- package/dist/lib.d.ts +3 -0
- package/dist/lib.js +33 -0
- package/dist/lib.mjs +24 -0
- package/dist/plugin.d.mts +11 -0
- package/dist/plugin.d.ts +104 -0
- package/dist/plugin.js +1 -0
- package/dist/plugin.mjs +1 -0
- package/dist/resolve-config-BIFUA2FY.d.ts +29 -0
- package/dist/resolve-config-QUZ9b-Gn.d.mts +190 -0
- package/dist/types-B254mqw1.d.mts +98 -0
- package/index.css +865 -0
- package/package.json +73 -110
- package/preflight.css +383 -0
- package/theme.css +453 -0
- package/CHANGELOG.md +0 -1742
- package/base.css +0 -1
- package/colors.js +0 -304
- package/components.css +0 -1
- package/defaultConfig.js +0 -4
- package/defaultTheme.js +0 -4
- package/lib/cli-peer-dependencies.js +0 -20
- package/lib/cli.js +0 -765
- package/lib/constants.js +0 -37
- package/lib/corePluginList.js +0 -8
- package/lib/corePlugins.js +0 -2977
- package/lib/css/LICENSE +0 -25
- package/lib/css/preflight.css +0 -354
- package/lib/featureFlags.js +0 -60
- package/lib/index.js +0 -31
- package/lib/lib/collapseAdjacentRules.js +0 -43
- package/lib/lib/evaluateTailwindFunctions.js +0 -192
- package/lib/lib/expandApplyAtRules.js +0 -245
- package/lib/lib/expandTailwindAtRules.js +0 -260
- package/lib/lib/generateRules.js +0 -362
- package/lib/lib/getModuleDependencies.js +0 -53
- package/lib/lib/normalizeTailwindDirectives.js +0 -68
- package/lib/lib/resolveDefaultsAtRules.js +0 -105
- package/lib/lib/setupContextUtils.js +0 -643
- package/lib/lib/setupTrackingContext.js +0 -190
- package/lib/lib/setupWatchingContext.js +0 -331
- package/lib/lib/sharedState.js +0 -29
- package/lib/lib/substituteScreenAtRules.js +0 -31
- package/lib/processTailwindFeatures.js +0 -57
- package/lib/util/bigSign.js +0 -10
- package/lib/util/buildMediaQuery.js +0 -36
- package/lib/util/cloneDeep.js +0 -18
- package/lib/util/cloneNodes.js +0 -18
- package/lib/util/color.js +0 -74
- package/lib/util/configurePlugins.js +0 -19
- package/lib/util/createPlugin.js +0 -33
- package/lib/util/createUtilityPlugin.js +0 -51
- package/lib/util/defaults.js +0 -20
- package/lib/util/escapeClassName.js +0 -21
- package/lib/util/escapeCommas.js +0 -10
- package/lib/util/flattenColorPalette.js +0 -15
- package/lib/util/getAllConfigs.js +0 -22
- package/lib/util/hashConfig.js +0 -16
- package/lib/util/isKeyframeRule.js +0 -10
- package/lib/util/isPlainObject.js +0 -15
- package/lib/util/log.js +0 -38
- package/lib/util/nameClass.js +0 -32
- package/lib/util/negateValue.js +0 -20
- package/lib/util/parseAnimationValue.js +0 -60
- package/lib/util/parseDependency.js +0 -74
- package/lib/util/parseObjectStyles.js +0 -28
- package/lib/util/pluginUtils.js +0 -318
- package/lib/util/prefixSelector.js +0 -23
- package/lib/util/resolveConfig.js +0 -289
- package/lib/util/resolveConfigPath.js +0 -59
- package/lib/util/responsive.js +0 -18
- package/lib/util/tap.js +0 -11
- package/lib/util/toColorValue.js +0 -10
- package/lib/util/toPath.js +0 -11
- package/lib/util/transformThemeValue.js +0 -32
- package/lib/util/withAlphaVariable.js +0 -65
- package/nesting/README.md +0 -42
- package/nesting/index.js +0 -12
- package/nesting/plugin.js +0 -41
- package/peers/index.js +0 -87302
- package/plugin.js +0 -3
- package/prettier.config.js +0 -19
- package/resolveConfig.js +0 -7
- package/screens.css +0 -1
- package/scripts/create-plugin-list.js +0 -10
- package/scripts/install-integrations.js +0 -27
- package/scripts/rebuildFixtures.js +0 -68
- package/src/cli-peer-dependencies.js +0 -9
- package/src/cli.js +0 -759
- package/src/constants.js +0 -17
- package/src/corePluginList.js +0 -1
- package/src/corePlugins.js +0 -2228
- package/src/css/LICENSE +0 -25
- package/src/css/preflight.css +0 -354
- package/src/featureFlags.js +0 -48
- package/src/index.js +0 -34
- package/src/lib/collapseAdjacentRules.js +0 -39
- package/src/lib/evaluateTailwindFunctions.js +0 -195
- package/src/lib/expandApplyAtRules.js +0 -251
- package/src/lib/expandTailwindAtRules.js +0 -262
- package/src/lib/generateRules.js +0 -319
- package/src/lib/getModuleDependencies.js +0 -39
- package/src/lib/normalizeTailwindDirectives.js +0 -77
- package/src/lib/resolveDefaultsAtRules.js +0 -105
- package/src/lib/setupContextUtils.js +0 -639
- package/src/lib/setupTrackingContext.js +0 -181
- package/src/lib/setupWatchingContext.js +0 -306
- package/src/lib/sharedState.js +0 -13
- package/src/lib/substituteScreenAtRules.js +0 -16
- package/src/processTailwindFeatures.js +0 -41
- package/src/util/bigSign.js +0 -3
- package/src/util/buildMediaQuery.js +0 -24
- package/src/util/cloneDeep.js +0 -11
- package/src/util/cloneNodes.js +0 -11
- package/src/util/color.js +0 -56
- package/src/util/configurePlugins.js +0 -23
- package/src/util/createPlugin.js +0 -27
- package/src/util/createUtilityPlugin.js +0 -46
- package/src/util/defaults.js +0 -11
- package/src/util/escapeClassName.js +0 -8
- package/src/util/escapeCommas.js +0 -3
- package/src/util/flattenColorPalette.js +0 -13
- package/src/util/getAllConfigs.js +0 -19
- package/src/util/hashConfig.js +0 -5
- package/src/util/isKeyframeRule.js +0 -3
- package/src/util/isPlainObject.js +0 -8
- package/src/util/log.js +0 -28
- package/src/util/nameClass.js +0 -22
- package/src/util/negateValue.js +0 -14
- package/src/util/parseAnimationValue.js +0 -62
- package/src/util/parseDependency.js +0 -45
- package/src/util/parseObjectStyles.js +0 -19
- package/src/util/pluginUtils.js +0 -295
- package/src/util/prefixSelector.js +0 -15
- package/src/util/resolveConfig.js +0 -282
- package/src/util/resolveConfigPath.js +0 -55
- package/src/util/responsive.js +0 -10
- package/src/util/tap.js +0 -4
- package/src/util/toColorValue.js +0 -3
- package/src/util/toPath.js +0 -4
- package/src/util/transformThemeValue.js +0 -37
- package/src/util/withAlphaVariable.js +0 -44
- package/stubs/defaultConfig.stub.js +0 -884
- package/stubs/defaultPostCssConfig.stub.js +0 -6
- package/stubs/simpleConfig.stub.js +0 -8
- package/tailwind.css +0 -5
- package/variants.css +0 -1
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
import negateValue from './negateValue'
|
|
2
|
-
import corePluginList from '../corePluginList'
|
|
3
|
-
import configurePlugins from './configurePlugins'
|
|
4
|
-
import defaultConfig from '../../stubs/defaultConfig.stub'
|
|
5
|
-
import colors from '../../colors'
|
|
6
|
-
import log from './log'
|
|
7
|
-
import { defaults } from './defaults'
|
|
8
|
-
import { toPath } from './toPath'
|
|
9
|
-
|
|
10
|
-
function isFunction(input) {
|
|
11
|
-
return typeof input === 'function'
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function isObject(input) {
|
|
15
|
-
return typeof input === 'object' && input !== null
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function mergeWith(target, ...sources) {
|
|
19
|
-
let customizer = sources.pop()
|
|
20
|
-
|
|
21
|
-
for (let source of sources) {
|
|
22
|
-
for (let k in source) {
|
|
23
|
-
let merged = customizer(target[k], source[k])
|
|
24
|
-
|
|
25
|
-
if (merged === undefined) {
|
|
26
|
-
if (isObject(target[k]) && isObject(source[k])) {
|
|
27
|
-
target[k] = mergeWith(target[k], source[k], customizer)
|
|
28
|
-
} else {
|
|
29
|
-
target[k] = source[k]
|
|
30
|
-
}
|
|
31
|
-
} else {
|
|
32
|
-
target[k] = merged
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return target
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const configUtils = {
|
|
41
|
-
colors,
|
|
42
|
-
negative(scale) {
|
|
43
|
-
return Object.keys(scale)
|
|
44
|
-
.filter((key) => scale[key] !== '0')
|
|
45
|
-
.reduce(
|
|
46
|
-
(negativeScale, key) => ({
|
|
47
|
-
...negativeScale,
|
|
48
|
-
[`-${key}`]: negateValue(scale[key]),
|
|
49
|
-
}),
|
|
50
|
-
{}
|
|
51
|
-
)
|
|
52
|
-
},
|
|
53
|
-
breakpoints(screens) {
|
|
54
|
-
return Object.keys(screens)
|
|
55
|
-
.filter((key) => typeof screens[key] === 'string')
|
|
56
|
-
.reduce(
|
|
57
|
-
(breakpoints, key) => ({
|
|
58
|
-
...breakpoints,
|
|
59
|
-
[`screen-${key}`]: screens[key],
|
|
60
|
-
}),
|
|
61
|
-
{}
|
|
62
|
-
)
|
|
63
|
-
},
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function value(valueToResolve, ...args) {
|
|
67
|
-
return isFunction(valueToResolve) ? valueToResolve(...args) : valueToResolve
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function collectExtends(items) {
|
|
71
|
-
return items.reduce((merged, { extend }) => {
|
|
72
|
-
return mergeWith(merged, extend, (mergedValue, extendValue) => {
|
|
73
|
-
if (mergedValue === undefined) {
|
|
74
|
-
return [extendValue]
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (Array.isArray(mergedValue)) {
|
|
78
|
-
return [extendValue, ...mergedValue]
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return [extendValue, mergedValue]
|
|
82
|
-
})
|
|
83
|
-
}, {})
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function mergeThemes(themes) {
|
|
87
|
-
return {
|
|
88
|
-
...themes.reduce((merged, theme) => defaults(merged, theme), {}),
|
|
89
|
-
|
|
90
|
-
// In order to resolve n config objects, we combine all of their `extend` properties
|
|
91
|
-
// into arrays instead of objects so they aren't overridden.
|
|
92
|
-
extend: collectExtends(themes),
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function mergeExtensionCustomizer(merged, value) {
|
|
97
|
-
// When we have an array of objects, we do want to merge it
|
|
98
|
-
if (Array.isArray(merged) && isObject(merged[0])) {
|
|
99
|
-
return merged.concat(value)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// When the incoming value is an array, and the existing config is an object, prepend the existing object
|
|
103
|
-
if (Array.isArray(value) && isObject(value[0]) && isObject(merged)) {
|
|
104
|
-
return [merged, ...value]
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Override arrays (for example for font-families, box-shadows, ...)
|
|
108
|
-
if (Array.isArray(value)) {
|
|
109
|
-
return value
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Execute default behaviour
|
|
113
|
-
return undefined
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function mergeExtensions({ extend, ...theme }) {
|
|
117
|
-
return mergeWith(theme, extend, (themeValue, extensions) => {
|
|
118
|
-
// The `extend` property is an array, so we need to check if it contains any functions
|
|
119
|
-
if (!isFunction(themeValue) && !extensions.some(isFunction)) {
|
|
120
|
-
return mergeWith({}, themeValue, ...extensions, mergeExtensionCustomizer)
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return (resolveThemePath, utils) =>
|
|
124
|
-
mergeWith(
|
|
125
|
-
{},
|
|
126
|
-
...[themeValue, ...extensions].map((e) => value(e, resolveThemePath, utils)),
|
|
127
|
-
mergeExtensionCustomizer
|
|
128
|
-
)
|
|
129
|
-
})
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function resolveFunctionKeys(object) {
|
|
133
|
-
const resolvePath = (key, defaultValue) => {
|
|
134
|
-
const path = toPath(key)
|
|
135
|
-
|
|
136
|
-
let index = 0
|
|
137
|
-
let val = object
|
|
138
|
-
|
|
139
|
-
while (val !== undefined && val !== null && index < path.length) {
|
|
140
|
-
val = val[path[index++]]
|
|
141
|
-
val = isFunction(val) ? val(resolvePath, configUtils) : val
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return val === undefined ? defaultValue : val
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
resolvePath.theme = resolvePath
|
|
148
|
-
|
|
149
|
-
for (let key in configUtils) {
|
|
150
|
-
resolvePath[key] = configUtils[key]
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return Object.keys(object).reduce((resolved, key) => {
|
|
154
|
-
return {
|
|
155
|
-
...resolved,
|
|
156
|
-
[key]: isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key],
|
|
157
|
-
}
|
|
158
|
-
}, {})
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
function extractPluginConfigs(configs) {
|
|
162
|
-
let allConfigs = []
|
|
163
|
-
|
|
164
|
-
configs.forEach((config) => {
|
|
165
|
-
allConfigs = [...allConfigs, config]
|
|
166
|
-
|
|
167
|
-
const plugins = config?.plugins ?? []
|
|
168
|
-
|
|
169
|
-
if (plugins.length === 0) {
|
|
170
|
-
return
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
plugins.forEach((plugin) => {
|
|
174
|
-
if (plugin.__isOptionsFunction) {
|
|
175
|
-
plugin = plugin()
|
|
176
|
-
}
|
|
177
|
-
allConfigs = [...allConfigs, ...extractPluginConfigs([plugin?.config ?? {}])]
|
|
178
|
-
})
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
return allConfigs
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function resolveCorePlugins(corePluginConfigs) {
|
|
185
|
-
const result = [...corePluginConfigs].reduceRight((resolved, corePluginConfig) => {
|
|
186
|
-
if (isFunction(corePluginConfig)) {
|
|
187
|
-
return corePluginConfig({ corePlugins: resolved })
|
|
188
|
-
}
|
|
189
|
-
return configurePlugins(corePluginConfig, resolved)
|
|
190
|
-
}, corePluginList)
|
|
191
|
-
|
|
192
|
-
return result
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
function resolvePluginLists(pluginLists) {
|
|
196
|
-
const result = [...pluginLists].reduceRight((resolved, pluginList) => {
|
|
197
|
-
return [...resolved, ...pluginList]
|
|
198
|
-
}, [])
|
|
199
|
-
|
|
200
|
-
return result
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export default function resolveConfig(configs) {
|
|
204
|
-
let allConfigs = [
|
|
205
|
-
...extractPluginConfigs(configs),
|
|
206
|
-
{
|
|
207
|
-
prefix: '',
|
|
208
|
-
important: false,
|
|
209
|
-
separator: ':',
|
|
210
|
-
variantOrder: defaultConfig.variantOrder,
|
|
211
|
-
},
|
|
212
|
-
]
|
|
213
|
-
|
|
214
|
-
return normalizeConfig(
|
|
215
|
-
defaults(
|
|
216
|
-
{
|
|
217
|
-
theme: resolveFunctionKeys(
|
|
218
|
-
mergeExtensions(mergeThemes(allConfigs.map((t) => t?.theme ?? {})))
|
|
219
|
-
),
|
|
220
|
-
corePlugins: resolveCorePlugins(allConfigs.map((c) => c.corePlugins)),
|
|
221
|
-
plugins: resolvePluginLists(configs.map((c) => c?.plugins ?? [])),
|
|
222
|
-
},
|
|
223
|
-
...allConfigs
|
|
224
|
-
)
|
|
225
|
-
)
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
let warnedAbout = new Set()
|
|
229
|
-
function normalizeConfig(config) {
|
|
230
|
-
if (!warnedAbout.has('purge-deprecation') && config.hasOwnProperty('purge')) {
|
|
231
|
-
log.warn([
|
|
232
|
-
'The `purge` option in your tailwind.config.js file has been deprecated.',
|
|
233
|
-
'Please rename this to `content` instead.',
|
|
234
|
-
])
|
|
235
|
-
warnedAbout.add('purge-deprecation')
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
config.content = {
|
|
239
|
-
content: (() => {
|
|
240
|
-
let { content, purge } = config
|
|
241
|
-
|
|
242
|
-
if (Array.isArray(purge)) return purge
|
|
243
|
-
if (Array.isArray(purge?.content)) return purge.content
|
|
244
|
-
if (Array.isArray(content)) return content
|
|
245
|
-
if (Array.isArray(content?.content)) return content.content
|
|
246
|
-
|
|
247
|
-
return []
|
|
248
|
-
})(),
|
|
249
|
-
safelist: (() => {
|
|
250
|
-
let { content, purge } = config
|
|
251
|
-
|
|
252
|
-
let [safelistKey, safelistPaths] = (() => {
|
|
253
|
-
if (Array.isArray(content?.safelist)) return ['content.safelist', content.safelist]
|
|
254
|
-
if (Array.isArray(purge?.safelist)) return ['purge.safelist', purge.safelist]
|
|
255
|
-
if (Array.isArray(purge?.options?.safelist))
|
|
256
|
-
return ['purge.options.safelist', purge.options.safelist]
|
|
257
|
-
return [null, []]
|
|
258
|
-
})()
|
|
259
|
-
|
|
260
|
-
return safelistPaths.map((content) => {
|
|
261
|
-
if (typeof content === 'string') {
|
|
262
|
-
return { raw: content, extension: 'html' }
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
if (content instanceof RegExp) {
|
|
266
|
-
throw new Error(
|
|
267
|
-
`Values inside '${safelistKey}' can only be of type 'string', found 'regex'.`
|
|
268
|
-
)
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
throw new Error(
|
|
272
|
-
`Values inside '${safelistKey}' can only be of type 'string', found '${typeof content}'.`
|
|
273
|
-
)
|
|
274
|
-
})
|
|
275
|
-
})(),
|
|
276
|
-
extract: config.content?.extract || config.purge?.extract || {},
|
|
277
|
-
options: config.content?.options || config.purge?.options || {},
|
|
278
|
-
transform: config.content?.transform || config.purge?.transform || {},
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
return config
|
|
282
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import fs from 'fs'
|
|
2
|
-
import path from 'path'
|
|
3
|
-
|
|
4
|
-
function isObject(value) {
|
|
5
|
-
return typeof value === 'object' && value !== null
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function isEmpty(obj) {
|
|
9
|
-
return Object.keys(obj).length === 0
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function isString(value) {
|
|
13
|
-
return typeof value === 'string' || value instanceof String
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default function resolveConfigPath(pathOrConfig) {
|
|
17
|
-
// require('tailwindcss')({ theme: ..., variants: ... })
|
|
18
|
-
if (isObject(pathOrConfig) && pathOrConfig.config === undefined && !isEmpty(pathOrConfig)) {
|
|
19
|
-
return null
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// require('tailwindcss')({ config: 'custom-config.js' })
|
|
23
|
-
if (
|
|
24
|
-
isObject(pathOrConfig) &&
|
|
25
|
-
pathOrConfig.config !== undefined &&
|
|
26
|
-
isString(pathOrConfig.config)
|
|
27
|
-
) {
|
|
28
|
-
return path.resolve(pathOrConfig.config)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// require('tailwindcss')({ config: { theme: ..., variants: ... } })
|
|
32
|
-
if (
|
|
33
|
-
isObject(pathOrConfig) &&
|
|
34
|
-
pathOrConfig.config !== undefined &&
|
|
35
|
-
isObject(pathOrConfig.config)
|
|
36
|
-
) {
|
|
37
|
-
return null
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// require('tailwindcss')('custom-config.js')
|
|
41
|
-
if (isString(pathOrConfig)) {
|
|
42
|
-
return path.resolve(pathOrConfig)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// require('tailwindcss')
|
|
46
|
-
for (const configFile of ['./tailwind.config.js', './tailwind.config.cjs']) {
|
|
47
|
-
try {
|
|
48
|
-
const configPath = path.resolve(configFile)
|
|
49
|
-
fs.accessSync(configPath)
|
|
50
|
-
return configPath
|
|
51
|
-
} catch (err) {}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return null
|
|
55
|
-
}
|
package/src/util/responsive.js
DELETED
package/src/util/tap.js
DELETED
package/src/util/toColorValue.js
DELETED
package/src/util/toPath.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import postcss from 'postcss'
|
|
2
|
-
|
|
3
|
-
export default function transformThemeValue(themeSection) {
|
|
4
|
-
if (['fontSize', 'outline'].includes(themeSection)) {
|
|
5
|
-
return (value) => (Array.isArray(value) ? value[0] : value)
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
[
|
|
10
|
-
'fontFamily',
|
|
11
|
-
'boxShadow',
|
|
12
|
-
'transitionProperty',
|
|
13
|
-
'transitionDuration',
|
|
14
|
-
'transitionDelay',
|
|
15
|
-
'transitionTimingFunction',
|
|
16
|
-
'backgroundImage',
|
|
17
|
-
'backgroundSize',
|
|
18
|
-
'backgroundColor',
|
|
19
|
-
'cursor',
|
|
20
|
-
'animation',
|
|
21
|
-
].includes(themeSection)
|
|
22
|
-
) {
|
|
23
|
-
return (value) => (Array.isArray(value) ? value.join(', ') : value)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// For backwards compatibility reasons, before we switched to underscores
|
|
27
|
-
// instead of commas for arbitrary values.
|
|
28
|
-
if (['gridTemplateColumns', 'gridTemplateRows', 'objectPosition'].includes(themeSection)) {
|
|
29
|
-
return (value) => (typeof value === 'string' ? postcss.list.comma(value).join(' ') : value)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (themeSection === 'colors') {
|
|
33
|
-
return (value) => (typeof value === 'function' ? value({}) : value)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return (value) => value
|
|
37
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { parseColor, formatColor } from './color'
|
|
2
|
-
|
|
3
|
-
export function withAlphaValue(color, alphaValue, defaultValue) {
|
|
4
|
-
if (typeof color === 'function') {
|
|
5
|
-
return color({ opacityValue: alphaValue })
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
let parsed = parseColor(color)
|
|
9
|
-
|
|
10
|
-
if (parsed === null) {
|
|
11
|
-
return defaultValue
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return formatColor({ ...parsed, alpha: alphaValue })
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default function withAlphaVariable({ color, property, variable }) {
|
|
18
|
-
if (typeof color === 'function') {
|
|
19
|
-
return {
|
|
20
|
-
[variable]: '1',
|
|
21
|
-
[property]: color({ opacityVariable: variable, opacityValue: `var(${variable})` }),
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const parsed = parseColor(color)
|
|
26
|
-
|
|
27
|
-
if (parsed === null) {
|
|
28
|
-
return {
|
|
29
|
-
[property]: color,
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (parsed.alpha !== undefined) {
|
|
34
|
-
// Has an alpha value, return color as-is
|
|
35
|
-
return {
|
|
36
|
-
[property]: color,
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
[variable]: '1',
|
|
42
|
-
[property]: formatColor({ ...parsed, alpha: `var(${variable})` }),
|
|
43
|
-
}
|
|
44
|
-
}
|