winduum 2.2.9 → 2.2.11
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/dist/main.css +1 -1
- package/package.json +13 -14
- package/plugin/index.cjs +219 -217
- package/plugin/index.js +94 -94
- package/plugin/utilities/color.js +52 -50
- package/plugin/utilities/common.js +60 -60
- package/plugin/utilities/divide-gap.js +19 -19
- package/plugin/utilities/dot.js +10 -10
- package/src/base/defaults.css +2 -2
- package/src/base/reset.css +4 -2
- package/src/common.js +6 -6
- package/src/components/badge/props/default.css +2 -1
- package/src/components/breadcrumb/default.css +2 -1
- package/src/components/breadcrumb/props/default.css +2 -1
- package/src/components/button/interactive.css +3 -1
- package/src/components/button/props/default.css +2 -1
- package/src/components/button/props/interactive.css +2 -1
- package/src/components/card/props/default.css +2 -1
- package/src/components/carousel/content.css +2 -1
- package/src/components/carousel/index.js +128 -126
- package/src/components/check/default.css +1 -1
- package/src/components/check/props/default.css +4 -3
- package/src/components/color/default.css +2 -1
- package/src/components/color/interactive.css +2 -1
- package/src/components/color/props/default.css +3 -2
- package/src/components/compare/default.css +2 -1
- package/src/components/compare/index.js +9 -9
- package/src/components/control/icon.css +4 -2
- package/src/components/control/interactive.css +2 -1
- package/src/components/control/props/color.css +2 -1
- package/src/components/control/props/default.css +5 -4
- package/src/components/control/props/floating.css +2 -1
- package/src/components/control/props/icon.css +2 -1
- package/src/components/control/props/select-picker.css +4 -3
- package/src/components/control/props/select.css +2 -1
- package/src/components/control/select-picker.css +4 -2
- package/src/components/control/select.css +1 -1
- package/src/components/details/index.js +39 -38
- package/src/components/dialog/default.css +2 -1
- package/src/components/dialog/index.d.ts +1 -1
- package/src/components/dialog/index.js +42 -40
- package/src/components/dialog/props/content.css +2 -1
- package/src/components/dialog/props/default.css +2 -1
- package/src/components/drawer/default.css +2 -1
- package/src/components/drawer/index.js +29 -29
- package/src/components/drawer/props/content.css +2 -1
- package/src/components/drawer/props/default.css +2 -1
- package/src/components/form/index.js +83 -80
- package/src/components/heading/props/default.css +2 -1
- package/src/components/info/props/default.css +2 -1
- package/src/components/label/props/default.css +2 -1
- package/src/components/link/props/default.css +2 -1
- package/src/components/notice/props/default.css +2 -1
- package/src/components/popover/content.css +4 -2
- package/src/components/popover/index.js +45 -44
- package/src/components/popover/props/content.css +2 -1
- package/src/components/progress/props/default.css +2 -1
- package/src/components/range/index.js +37 -37
- package/src/components/range/props/default.css +2 -1
- package/src/components/rating/default.css +1 -1
- package/src/components/rating/props/default.css +2 -1
- package/src/components/switch/props/default.css +4 -3
- package/src/components/table/interactive.css +10 -5
- package/src/components/table/props/default.css +2 -1
- package/src/components/tabs/index.js +5 -5
- package/src/components/text/default.css +16 -1
- package/src/components/text/props/default.css +2 -1
- package/src/components/title/props/default.css +2 -1
- package/src/components/toast/index.js +25 -25
- package/src/components/toast/props/content.css +2 -1
- package/src/components/toast/props/default.css +2 -1
- package/src/components/toaster/index.js +3 -3
- package/src/components/toaster/props/default.css +2 -1
- package/src/components/tooltip/default.css +4 -2
- package/src/components/tooltip/props/default.css +2 -1
- package/src/theme/config/font.css +2 -1
- package/src/theme/config/radius.css +2 -1
- package/src/theme/config/spacing.css +2 -1
- package/src/theme/config/transition.css +2 -1
- package/src/theme/config/z.css +2 -1
- package/src/theme/dark-rgb.css +2 -1
- package/src/theme/dark.css +2 -1
- package/src/theme/default-p3.css +2 -1
- package/src/theme/default-rgb.css +3 -2
- package/src/theme/default.css +3 -2
- package/src/utilities/container/props/default.css +2 -1
- package/src/utilities/divider.css +5 -3
- package/src/utilities/dot.css +1 -1
- package/src/utilities/ripple/index.js +13 -13
- package/src/utilities/skeleton/props/default.css +2 -1
- package/src/utilities/spinner/default.css +4 -4
- package/src/utilities/spinner/ring.css +1 -1
- package/src/utilities/swap/index.js +4 -4
- package/tailwind.config.js +16 -17
- package/tailwindcss/base/defaults.css +3 -2
- package/tailwindcss/theme/config/transition.css +2 -1
- package/tailwindcss/theme/default.css +1 -1
- package/tailwindcss/utilities/divider.css +4 -2
- package/tailwindcss/utilities/dot.css +1 -1
- package/tailwindcss/utilities/spinner.css +5 -5
- package/types/index.d.ts +1 -1
package/plugin/index.js
CHANGED
|
@@ -3,12 +3,12 @@ import flattenColorPalette from 'tailwindcss/src/util/flattenColorPalette'
|
|
|
3
3
|
import divideGap from './utilities/divide-gap.js'
|
|
4
4
|
import { accentColor, textColor } from './utilities/color.js'
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
tailwindAnimations,
|
|
7
|
+
tailwindColors,
|
|
8
|
+
tailwindParseVariables,
|
|
9
|
+
tailwindPropertyUtilities,
|
|
10
|
+
tailwindVariables,
|
|
11
|
+
tailwindVariablesFont,
|
|
12
12
|
} from './utilities/common.js'
|
|
13
13
|
import { dirname, resolve } from 'node:path'
|
|
14
14
|
import { fileURLToPath } from 'node:url'
|
|
@@ -19,103 +19,103 @@ const relativePath = file => resolve(dirname(fileURLToPath(import.meta.url)), fi
|
|
|
19
19
|
* @type {import('./').PluginOptions} options.
|
|
20
20
|
*/
|
|
21
21
|
export const defaultConfig = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
animations: ['ripple', 'spin', 'move-indeterminate', 'fade-in', 'fade-out'],
|
|
23
|
+
screens: {
|
|
24
|
+
'xs': '22.5rem',
|
|
25
|
+
'sm': '26rem',
|
|
26
|
+
'md': '46.5rem',
|
|
27
|
+
'lg': '60rem',
|
|
28
|
+
'xl': '76rem',
|
|
29
|
+
'2xl': '82rem',
|
|
30
|
+
'3xl': '88rem',
|
|
31
|
+
'4xl': '100rem',
|
|
32
|
+
'xxl': '126rem',
|
|
33
|
+
'2xxl': '158rem',
|
|
34
|
+
},
|
|
35
|
+
settings: {
|
|
36
|
+
rgb: false,
|
|
37
|
+
colorMix: true,
|
|
38
|
+
},
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* @param {import('./').PluginOptions} userConfig
|
|
43
43
|
*/
|
|
44
44
|
export const createPlugin = (userConfig = {}) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
const settings = {
|
|
46
|
+
...defaultConfig.settings,
|
|
47
|
+
...userConfig.settings,
|
|
48
|
+
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
userConfig = {
|
|
51
|
+
...defaultConfig,
|
|
52
|
+
...userConfig,
|
|
53
|
+
settings,
|
|
54
|
+
}
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
56
|
+
return plugin(({ addComponents, matchUtilities, theme, e, corePlugins }) => {
|
|
57
|
+
matchUtilities(
|
|
58
|
+
{
|
|
59
|
+
accent: value => accentColor({ value }, userConfig.settings),
|
|
60
|
+
},
|
|
61
|
+
{ values: flattenColorPalette(theme('accentColor')), type: ['color', 'any'] },
|
|
62
|
+
)
|
|
63
|
+
matchUtilities(
|
|
64
|
+
{
|
|
65
|
+
text: value => textColor({ value, corePlugins }, userConfig.settings),
|
|
66
|
+
},
|
|
67
|
+
{ values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] },
|
|
68
|
+
)
|
|
69
|
+
addComponents(tailwindAnimations(userConfig.animations))
|
|
70
|
+
addComponents(tailwindPropertyUtilities('mask', Object.keys(tailwindParseVariables('mask', relativePath('../src/theme/config/mask.css'), {
|
|
71
|
+
...tailwindVariables('mask', userConfig.mask ?? []),
|
|
72
|
+
}, userConfig.mask, false))))
|
|
73
|
+
addComponents(divideGap({ theme, e }))
|
|
74
|
+
}, {
|
|
75
|
+
corePlugins: {
|
|
76
|
+
preflight: false,
|
|
77
|
+
textColor: false,
|
|
78
|
+
accentColor: false,
|
|
79
|
+
},
|
|
80
|
+
theme: {
|
|
81
|
+
extend: {
|
|
82
|
+
transitionProperty: {
|
|
83
|
+
DEFAULT: 'var(--default-transition-property)',
|
|
79
84
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}, userConfig.borderRadius),
|
|
115
|
-
screens: userConfig.screens
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
})
|
|
85
|
+
transitionDuration: {
|
|
86
|
+
DEFAULT: 'var(--default-transition-duration)',
|
|
87
|
+
},
|
|
88
|
+
transitionTimingFunction: tailwindParseVariables('ease', relativePath('../src/theme/config/transition.css'), {
|
|
89
|
+
...tailwindVariables('ease', userConfig.ease ?? []),
|
|
90
|
+
}, userConfig.ease),
|
|
91
|
+
colors: tailwindColors(Object.keys(tailwindParseVariables('color', relativePath('../src/theme/default.css'), {
|
|
92
|
+
...tailwindVariables('color', userConfig.colors ?? []),
|
|
93
|
+
}, userConfig.colors)), settings.colorMix, settings.rgb),
|
|
94
|
+
fontSize: tailwindParseVariables('text', relativePath('../src/theme/config/font.css'), {
|
|
95
|
+
...tailwindVariables('text', userConfig.fontSize ?? []),
|
|
96
|
+
}, userConfig.fontSize),
|
|
97
|
+
fontFamily: tailwindParseVariables('font', relativePath('../src/theme/config/font.css'), {
|
|
98
|
+
...tailwindVariables('font', userConfig.fontFamily ?? []),
|
|
99
|
+
}, userConfig.fontFamily),
|
|
100
|
+
fontWeight: tailwindParseVariables('font-weight', relativePath('../src/theme/config/font.css'), {
|
|
101
|
+
...tailwindVariables('font-weight', userConfig.fontWeight ?? []),
|
|
102
|
+
}, userConfig.fontWeight),
|
|
103
|
+
zIndex: tailwindParseVariables('z-index', relativePath('../src/theme/config/z.css'), {
|
|
104
|
+
...tailwindVariables('z-index', userConfig.zIndex ?? []),
|
|
105
|
+
0: 0,
|
|
106
|
+
auto: 'auto',
|
|
107
|
+
}, userConfig.zIndex),
|
|
108
|
+
spacing: tailwindParseVariables('spacing', relativePath('../src/theme/config/spacing.css'), {
|
|
109
|
+
...tailwindVariables('spacing', userConfig.spacing ?? []),
|
|
110
|
+
}, userConfig.spacing),
|
|
111
|
+
borderRadius: tailwindParseVariables('radius', relativePath('../src/theme/config/radius.css'), {
|
|
112
|
+
...tailwindVariables('radius', userConfig.borderRadius ?? []),
|
|
113
|
+
DEFAULT: 'var(--radius-xl)',
|
|
114
|
+
}, userConfig.borderRadius),
|
|
115
|
+
screens: userConfig.screens,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
})
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
export { tailwindAnimations, tailwindColors, tailwindPropertyUtilities, tailwindVariables, tailwindVariablesFont }
|
|
@@ -2,68 +2,70 @@ import withAlphaVariable from 'tailwindcss/src/util/withAlphaVariable'
|
|
|
2
2
|
import toColorValue from 'tailwindcss/src/util/toColorValue'
|
|
3
3
|
|
|
4
4
|
export const accentColor = ({ value }, settings) => {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
|
|
6
|
+
const colorProperties = {}
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`var(${matchValue[1].includes('-rgb') ? matchValue[1] : matchValue[1] + '-rgb'})`
|
|
12
|
-
|
|
13
|
-
`var(${matchValue[1].includes('-rgb') ? matchValue[1].replace('-rgb', '-foreground-rgb') : matchValue[1] + '-foreground-rgb, var(--color-light-rgb)'})`
|
|
14
|
-
|
|
8
|
+
if (matchValue) {
|
|
9
|
+
if (settings.rgb) {
|
|
10
|
+
colorProperties['--color-accent-rgb']
|
|
11
|
+
= `var(${matchValue[1].includes('-rgb') ? matchValue[1] : matchValue[1] + '-rgb'})`
|
|
12
|
+
colorProperties['--color-accent-foreground-rgb']
|
|
13
|
+
= `var(${matchValue[1].includes('-rgb') ? matchValue[1].replace('-rgb', '-foreground-rgb') : matchValue[1] + '-foreground-rgb, var(--color-light-rgb)'})`
|
|
14
|
+
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if (toColorValue(value).includes('calc(1 * 100%)') || toColorValue(value).includes(' / 1')) {
|
|
17
|
+
colorProperties['--color-accent'] = matchValue[0].replace('-rgb', '')
|
|
18
|
+
colorProperties['--color-accent-foreground'] = `var(${matchValue[1].replace('-rgb', '')}-foreground, var(--color-light))`
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
return {
|
|
21
|
+
...colorProperties,
|
|
22
|
+
'accent-color': settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))',
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
if (matchValue[1].includes('-rgb')) {
|
|
27
|
+
colorProperties['--color-accent'] = toColorValue(value)
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
colorProperties['--color-accent'] = settings.rgb ? `rgb(var(--color-accent-rgb) / ${toColorValue(value).match(/calc\((.*?)\)/)[0]})` : toColorValue(value)
|
|
31
|
+
}
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
colorProperties['--color-accent-foreground'] = settings.rgb ? 'rgb(var(--color-accent-foreground-rgb))' : `var(${matchValue[1]}-foreground, var(--color-light))`
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
35
|
+
return {
|
|
36
|
+
...colorProperties,
|
|
37
|
+
'accent-color': settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))',
|
|
38
|
+
}
|
|
38
39
|
}
|
|
40
|
+
}
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
return {
|
|
43
|
+
'--color-accent': toColorValue(value),
|
|
44
|
+
'accent-color': 'var(--color-accent)',
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
export const textColor = ({ value, corePlugins }, settings) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
|
|
50
|
+
const withCurrentRgb = {}
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (!corePlugins('textOpacity')) {
|
|
55
|
-
return {
|
|
56
|
-
...withCurrentRgb,
|
|
57
|
-
color: toColorValue(value)
|
|
58
|
-
}
|
|
59
|
-
}
|
|
52
|
+
if (matchValue && settings.rgb) {
|
|
53
|
+
withCurrentRgb['--tw-text-current-rgb'] = matchValue[1].includes('rgb') ? matchValue[0] : `var(${matchValue[1]}-rgb)`
|
|
54
|
+
}
|
|
60
55
|
|
|
56
|
+
if (!corePlugins('textOpacity')) {
|
|
61
57
|
return {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
color: value,
|
|
65
|
-
property: 'color',
|
|
66
|
-
variable: '--tw-text-opacity'
|
|
67
|
-
})
|
|
58
|
+
...withCurrentRgb,
|
|
59
|
+
color: toColorValue(value),
|
|
68
60
|
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
...withCurrentRgb,
|
|
65
|
+
...withAlphaVariable({
|
|
66
|
+
color: value,
|
|
67
|
+
property: 'color',
|
|
68
|
+
variable: '--tw-text-opacity',
|
|
69
|
+
}),
|
|
70
|
+
}
|
|
69
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs'
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { resolve } from 'node:path'
|
|
3
|
+
import process from 'node:process'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @param {[]} colors
|
|
@@ -9,21 +9,21 @@ import { resolve, dirname } from 'node:path'
|
|
|
9
9
|
* @returns {Object}
|
|
10
10
|
*/
|
|
11
11
|
export const tailwindColors = (colors = [], colorMix = true, rgb = false) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const result = {
|
|
13
|
+
current: 'color-mix(in var(--default-color-space), currentcolor calc(<alpha-value> * 100%), var(--default-color-mix, transparent))',
|
|
14
|
+
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
colors.forEach((name) => {
|
|
17
|
+
if (rgb) {
|
|
18
|
+
result[name + '-rgb'] = `rgb(var(--color-${name}-rgb) / <alpha-value>)`
|
|
19
|
+
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
result[name] = colorMix
|
|
22
|
+
? `color-mix(in var(--default-color-space), var(--color-${name}) calc(<alpha-value> * 100%), var(--default-color-mix, transparent))`
|
|
23
|
+
: `rgb(var(--color-${name}) / <alpha-value>)`
|
|
24
|
+
})
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
return result
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -33,46 +33,46 @@ export const tailwindColors = (colors = [], colorMix = true, rgb = false) => {
|
|
|
33
33
|
* @returns {Object}
|
|
34
34
|
*/
|
|
35
35
|
export const tailwindVariables = (type, variables = [], values = {}) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
if (!Array.isArray(variables)) {
|
|
37
|
+
return values
|
|
38
|
+
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
variables.forEach((name) => {
|
|
41
|
+
values[name] = `var(--${type}-${name.replace(/\./g, '_')})`
|
|
42
|
+
})
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
return values
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export const tailwindParseVariables = (type, file, customValues = {}, customPath, initialValues = true) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
const parseFile = (fileContent) => {
|
|
49
|
+
const regex = /(--[\w-]+):\s*([^;]+);/g
|
|
50
|
+
const matches = [...fileContent.matchAll(regex)]
|
|
51
|
+
const variables = matches.map(match => [match[1], match[2]])
|
|
52
|
+
const values = {}
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
variables.forEach((match, index) => {
|
|
55
|
+
if (!match[0].startsWith(`--${type}-`) || match[0].endsWith('--line-height')) {
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
const name = match[0].replace(`--${type}-`, '')
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
values[name.replace(/_/g, '.')] = type === 'font-size' ? [`var(${match})`, `var(${variables[index + 1]})`] : `var(${initialValues ? match : match[0]})`
|
|
62
|
+
})
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
return values
|
|
65
|
+
}
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
const fileContent = readFileSync(file).toString()
|
|
68
|
+
const values = parseFile(fileContent)
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
if (customPath && !Array.isArray(customPath)) {
|
|
71
|
+
const customFileContent = readFileSync(resolve(process.cwd(), customPath)).toString()
|
|
72
|
+
customValues = { ...customValues, ...parseFile(customFileContent) }
|
|
73
|
+
}
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
return { ...values, ...customValues }
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/**
|
|
@@ -82,11 +82,11 @@ export const tailwindParseVariables = (type, file, customValues = {}, customPath
|
|
|
82
82
|
* @returns {Object}
|
|
83
83
|
*/
|
|
84
84
|
export const tailwindVariablesFont = (type, variables = [], values = {}) => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
variables.forEach(({ value, initial }) => {
|
|
86
|
+
values[value] = [`var(--${type}-${value}, ${initial})`, `calc(var(--${type}-${value}) + 0.5rem)`]
|
|
87
|
+
})
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
return values
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/**
|
|
@@ -95,15 +95,15 @@ export const tailwindVariablesFont = (type, variables = [], values = {}) => {
|
|
|
95
95
|
* @returns {Object}
|
|
96
96
|
*/
|
|
97
97
|
export const tailwindPropertyUtilities = (type, variables = []) => {
|
|
98
|
-
|
|
98
|
+
const result = {}
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
100
|
+
variables.forEach((name) => {
|
|
101
|
+
result[`.${type}-${name}`] = {
|
|
102
|
+
[type]: `var(--${type}-${name})`,
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
return result
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
@@ -111,13 +111,13 @@ export const tailwindPropertyUtilities = (type, variables = []) => {
|
|
|
111
111
|
* @returns {Object}
|
|
112
112
|
*/
|
|
113
113
|
export const tailwindAnimations = (values) => {
|
|
114
|
-
|
|
114
|
+
const result = {}
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
values.forEach((value) => {
|
|
117
|
+
result[`.animation-${value}`] = {
|
|
118
|
+
'animation-name': value,
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
return result
|
|
123
123
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export default function divideGap
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
export default function divideGap({ theme, e }) {
|
|
2
|
+
return [
|
|
3
|
+
...Object.entries(theme('spacing')).map(([key, value]) => {
|
|
4
|
+
return {
|
|
5
|
+
[`.${e(`divide-gap-x-${key}`)}`]: {
|
|
6
|
+
'& > :where(*:not(:first-child))': {
|
|
7
|
+
paddingLeft: value,
|
|
8
|
+
marginLeft: value,
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
[`.${e(`divide-gap-y-${key}`)}`]: {
|
|
12
|
+
'& > :where(*:not(:first-child))': {
|
|
13
|
+
paddingTop: value,
|
|
14
|
+
marginTop: value,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
]
|
|
20
20
|
}
|
package/plugin/utilities/dot.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
'.dot': {
|
|
3
|
+
display: 'inline-flex',
|
|
4
|
+
inlineSize: '0.5rem',
|
|
5
|
+
blockSize: '0.5rem',
|
|
6
|
+
borderRadius: 'var(--radius-full)',
|
|
7
|
+
backgroundColor: 'currentColor',
|
|
8
|
+
flexShrink: '0',
|
|
9
|
+
justifyContent: 'center',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
},
|
|
12
12
|
}
|
package/src/base/defaults.css
CHANGED
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:where(hr) {
|
|
36
|
-
background-color: color-mix(in var(--default-color-space),
|
|
36
|
+
background-color: color-mix(in var(--default-color-space), currentcolor 100%, transparent);
|
|
37
37
|
block-size: 1px;
|
|
38
38
|
inline-size: 100%;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
:where(code) {
|
|
42
42
|
padding: calc(var(--spacing) * 1) calc(var(--spacing) * 2);
|
|
43
|
-
background: var(--color-body-secondary);
|
|
43
|
+
background-color: var(--color-body-secondary);
|
|
44
44
|
border-radius: var(--radius-sm);
|
|
45
45
|
color: var(--color-accent);
|
|
46
46
|
}
|
package/src/base/reset.css
CHANGED
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
:where(option),
|
|
32
32
|
:where(output),
|
|
33
33
|
:where(p),
|
|
34
|
-
:where(pre),
|
|
35
34
|
:where(select),
|
|
36
35
|
:where(summary),
|
|
37
36
|
:where(table),
|
|
@@ -73,7 +72,10 @@
|
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
/* Improve consistency of default fonts in all browsers. */
|
|
76
|
-
:where(code),
|
|
75
|
+
:where(code),
|
|
76
|
+
:where(kbd),
|
|
77
|
+
:where(samp),
|
|
78
|
+
:where(pre) {
|
|
77
79
|
font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
|
|
78
80
|
font-size: 1em;
|
|
79
81
|
}
|
package/src/common.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export const nextRepaint = () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
})
|
|
2
|
+
return new Promise((resolve) => {
|
|
3
|
+
requestAnimationFrame(() => {
|
|
4
|
+
requestAnimationFrame(() => {
|
|
5
|
+
resolve()
|
|
6
|
+
})
|
|
8
7
|
})
|
|
8
|
+
})
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const animationsFinished = async element => Promise.all(element.getAnimations().map(animation => animation.finished))
|