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.
Files changed (101) hide show
  1. package/dist/main.css +1 -1
  2. package/package.json +13 -14
  3. package/plugin/index.cjs +219 -217
  4. package/plugin/index.js +94 -94
  5. package/plugin/utilities/color.js +52 -50
  6. package/plugin/utilities/common.js +60 -60
  7. package/plugin/utilities/divide-gap.js +19 -19
  8. package/plugin/utilities/dot.js +10 -10
  9. package/src/base/defaults.css +2 -2
  10. package/src/base/reset.css +4 -2
  11. package/src/common.js +6 -6
  12. package/src/components/badge/props/default.css +2 -1
  13. package/src/components/breadcrumb/default.css +2 -1
  14. package/src/components/breadcrumb/props/default.css +2 -1
  15. package/src/components/button/interactive.css +3 -1
  16. package/src/components/button/props/default.css +2 -1
  17. package/src/components/button/props/interactive.css +2 -1
  18. package/src/components/card/props/default.css +2 -1
  19. package/src/components/carousel/content.css +2 -1
  20. package/src/components/carousel/index.js +128 -126
  21. package/src/components/check/default.css +1 -1
  22. package/src/components/check/props/default.css +4 -3
  23. package/src/components/color/default.css +2 -1
  24. package/src/components/color/interactive.css +2 -1
  25. package/src/components/color/props/default.css +3 -2
  26. package/src/components/compare/default.css +2 -1
  27. package/src/components/compare/index.js +9 -9
  28. package/src/components/control/icon.css +4 -2
  29. package/src/components/control/interactive.css +2 -1
  30. package/src/components/control/props/color.css +2 -1
  31. package/src/components/control/props/default.css +5 -4
  32. package/src/components/control/props/floating.css +2 -1
  33. package/src/components/control/props/icon.css +2 -1
  34. package/src/components/control/props/select-picker.css +4 -3
  35. package/src/components/control/props/select.css +2 -1
  36. package/src/components/control/select-picker.css +4 -2
  37. package/src/components/control/select.css +1 -1
  38. package/src/components/details/index.js +39 -38
  39. package/src/components/dialog/default.css +2 -1
  40. package/src/components/dialog/index.d.ts +1 -1
  41. package/src/components/dialog/index.js +42 -40
  42. package/src/components/dialog/props/content.css +2 -1
  43. package/src/components/dialog/props/default.css +2 -1
  44. package/src/components/drawer/default.css +2 -1
  45. package/src/components/drawer/index.js +29 -29
  46. package/src/components/drawer/props/content.css +2 -1
  47. package/src/components/drawer/props/default.css +2 -1
  48. package/src/components/form/index.js +83 -80
  49. package/src/components/heading/props/default.css +2 -1
  50. package/src/components/info/props/default.css +2 -1
  51. package/src/components/label/props/default.css +2 -1
  52. package/src/components/link/props/default.css +2 -1
  53. package/src/components/notice/props/default.css +2 -1
  54. package/src/components/popover/content.css +4 -2
  55. package/src/components/popover/index.js +45 -44
  56. package/src/components/popover/props/content.css +2 -1
  57. package/src/components/progress/props/default.css +2 -1
  58. package/src/components/range/index.js +37 -37
  59. package/src/components/range/props/default.css +2 -1
  60. package/src/components/rating/default.css +1 -1
  61. package/src/components/rating/props/default.css +2 -1
  62. package/src/components/switch/props/default.css +4 -3
  63. package/src/components/table/interactive.css +10 -5
  64. package/src/components/table/props/default.css +2 -1
  65. package/src/components/tabs/index.js +5 -5
  66. package/src/components/text/default.css +16 -1
  67. package/src/components/text/props/default.css +2 -1
  68. package/src/components/title/props/default.css +2 -1
  69. package/src/components/toast/index.js +25 -25
  70. package/src/components/toast/props/content.css +2 -1
  71. package/src/components/toast/props/default.css +2 -1
  72. package/src/components/toaster/index.js +3 -3
  73. package/src/components/toaster/props/default.css +2 -1
  74. package/src/components/tooltip/default.css +4 -2
  75. package/src/components/tooltip/props/default.css +2 -1
  76. package/src/theme/config/font.css +2 -1
  77. package/src/theme/config/radius.css +2 -1
  78. package/src/theme/config/spacing.css +2 -1
  79. package/src/theme/config/transition.css +2 -1
  80. package/src/theme/config/z.css +2 -1
  81. package/src/theme/dark-rgb.css +2 -1
  82. package/src/theme/dark.css +2 -1
  83. package/src/theme/default-p3.css +2 -1
  84. package/src/theme/default-rgb.css +3 -2
  85. package/src/theme/default.css +3 -2
  86. package/src/utilities/container/props/default.css +2 -1
  87. package/src/utilities/divider.css +5 -3
  88. package/src/utilities/dot.css +1 -1
  89. package/src/utilities/ripple/index.js +13 -13
  90. package/src/utilities/skeleton/props/default.css +2 -1
  91. package/src/utilities/spinner/default.css +4 -4
  92. package/src/utilities/spinner/ring.css +1 -1
  93. package/src/utilities/swap/index.js +4 -4
  94. package/tailwind.config.js +16 -17
  95. package/tailwindcss/base/defaults.css +3 -2
  96. package/tailwindcss/theme/config/transition.css +2 -1
  97. package/tailwindcss/theme/default.css +1 -1
  98. package/tailwindcss/utilities/divider.css +4 -2
  99. package/tailwindcss/utilities/dot.css +1 -1
  100. package/tailwindcss/utilities/spinner.css +5 -5
  101. 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
- tailwindAnimations,
7
- tailwindColors,
8
- tailwindParseVariables,
9
- tailwindPropertyUtilities,
10
- tailwindVariables,
11
- tailwindVariablesFont
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
- 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
- }
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
- const settings = {
46
- ...defaultConfig.settings,
47
- ...userConfig.settings
48
- }
45
+ const settings = {
46
+ ...defaultConfig.settings,
47
+ ...userConfig.settings,
48
+ }
49
49
 
50
- userConfig = {
51
- ...defaultConfig,
52
- ...userConfig,
53
- settings
54
- }
50
+ userConfig = {
51
+ ...defaultConfig,
52
+ ...userConfig,
53
+ settings,
54
+ }
55
55
 
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
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
- theme: {
81
- extend: {
82
- transitionProperty: {
83
- DEFAULT: 'var(--default-transition-property)'
84
- },
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
- })
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
- const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
6
- const colorProperties = {}
5
+ const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
6
+ const colorProperties = {}
7
7
 
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
- }
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
- 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))`
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
- return {
21
- ...colorProperties,
22
- 'accent-color': settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))'
23
- }
24
- } else {
25
- if (matchValue[1].includes('-rgb')) {
26
- colorProperties['--color-accent'] = toColorValue(value)
27
- } else {
28
- colorProperties['--color-accent'] = settings.rgb ? `rgb(var(--color-accent-rgb) / ${toColorValue(value).match(/calc\((.*?)\)/)[0]})` : toColorValue(value)
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
- colorProperties['--color-accent-foreground'] = settings.rgb ? 'rgb(var(--color-accent-foreground-rgb))' : `var(${matchValue[1]}-foreground, var(--color-light))`
33
+ colorProperties['--color-accent-foreground'] = settings.rgb ? 'rgb(var(--color-accent-foreground-rgb))' : `var(${matchValue[1]}-foreground, var(--color-light))`
32
34
 
33
- return {
34
- ...colorProperties,
35
- 'accent-color': settings.colorMix ? 'var(--color-accent)' : 'rgb(var(--color-accent))'
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
- return {
41
- '--color-accent': toColorValue(value),
42
- 'accent-color': 'var(--color-accent)'
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
- const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
48
- const withCurrentRgb = {}
49
+ const matchValue = toColorValue(value).match(/var\((--color-.*?)\)/)
50
+ const withCurrentRgb = {}
49
51
 
50
- if (matchValue && settings.rgb) {
51
- withCurrentRgb['--tw-text-current-rgb'] = matchValue[1].includes('rgb') ? matchValue[0] : `var(${matchValue[1]}-rgb)`
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
- ...withCurrentRgb,
63
- ...withAlphaVariable({
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 { fileURLToPath } from 'node:url'
3
- import { resolve, dirname } from 'node:path'
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
- const result = {
13
- current: 'color-mix(in var(--default-color-space), currentcolor calc(<alpha-value> * 100%), var(--default-color-mix, transparent))'
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
- colors.forEach((name) => {
17
- if (rgb) {
18
- result[name + '-rgb'] = `rgb(var(--color-${name}-rgb) / <alpha-value>)`
19
- }
16
+ colors.forEach((name) => {
17
+ if (rgb) {
18
+ result[name + '-rgb'] = `rgb(var(--color-${name}-rgb) / <alpha-value>)`
19
+ }
20
20
 
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
- })
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
- return result
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
- if (!Array.isArray(variables)) {
37
- return values
38
- }
36
+ if (!Array.isArray(variables)) {
37
+ return values
38
+ }
39
39
 
40
- variables.forEach((name) => {
41
- values[name] = `var(--${type}-${name.replace(/\./g, '_')})`
42
- })
40
+ variables.forEach((name) => {
41
+ values[name] = `var(--${type}-${name.replace(/\./g, '_')})`
42
+ })
43
43
 
44
- return values
44
+ return values
45
45
  }
46
46
 
47
47
  export const tailwindParseVariables = (type, file, customValues = {}, customPath, initialValues = true) => {
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 = {}
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
- variables.forEach((match, index) => {
55
- if (!match[0].startsWith(`--${type}-`) || match[0].endsWith('--line-height')) {
56
- return
57
- }
54
+ variables.forEach((match, index) => {
55
+ if (!match[0].startsWith(`--${type}-`) || match[0].endsWith('--line-height')) {
56
+ return
57
+ }
58
58
 
59
- const name = match[0].replace(`--${type}-`, '')
59
+ const name = match[0].replace(`--${type}-`, '')
60
60
 
61
- values[name.replace(/_/g, '.')] = type === 'font-size' ? [`var(${match})`, `var(${variables[index + 1]})`] : `var(${initialValues ? match : match[0]})`
62
- })
61
+ values[name.replace(/_/g, '.')] = type === 'font-size' ? [`var(${match})`, `var(${variables[index + 1]})`] : `var(${initialValues ? match : match[0]})`
62
+ })
63
63
 
64
- return values
65
- }
64
+ return values
65
+ }
66
66
 
67
- const fileContent = readFileSync(file).toString()
68
- const values = parseFile(fileContent)
67
+ const fileContent = readFileSync(file).toString()
68
+ const values = parseFile(fileContent)
69
69
 
70
- if (customPath && !Array.isArray(customPath)) {
71
- const customFileContent = readFileSync(resolve(process.cwd(), customPath)).toString()
72
- customValues = { ...customValues, ...parseFile(customFileContent) }
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
- return { ...values, ...customValues }
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
- variables.forEach(({ value, initial }) => {
86
- values[value] = [`var(--${type}-${value}, ${initial})`, `calc(var(--${type}-${value}) + 0.5rem)`]
87
- })
85
+ variables.forEach(({ value, initial }) => {
86
+ values[value] = [`var(--${type}-${value}, ${initial})`, `calc(var(--${type}-${value}) + 0.5rem)`]
87
+ })
88
88
 
89
- return values
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
- const result = {}
98
+ const result = {}
99
99
 
100
- variables.forEach((name) => {
101
- result[`.${type}-${name}`] = {
102
- [type]: `var(--${type}-${name})`
103
- }
104
- })
100
+ variables.forEach((name) => {
101
+ result[`.${type}-${name}`] = {
102
+ [type]: `var(--${type}-${name})`,
103
+ }
104
+ })
105
105
 
106
- return result
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
- const result = {}
114
+ const result = {}
115
115
 
116
- values.forEach((value) => {
117
- result[`.animation-${value}`] = {
118
- 'animation-name': value
119
- }
120
- })
116
+ values.forEach((value) => {
117
+ result[`.animation-${value}`] = {
118
+ 'animation-name': value,
119
+ }
120
+ })
121
121
 
122
- return result
122
+ return result
123
123
  }
@@ -1,20 +1,20 @@
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
- ]
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
  }
@@ -1,12 +1,12 @@
1
1
  export default {
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
- }
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
  }
@@ -33,14 +33,14 @@
33
33
  }
34
34
 
35
35
  :where(hr) {
36
- background-color: color-mix(in var(--default-color-space), currentColor 100%, transparent);
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
  }
@@ -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), :where(kbd), :where(samp), :where(pre) {
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
- return new Promise((resolve) => {
3
- requestAnimationFrame(() => {
4
- requestAnimationFrame(() => {
5
- resolve()
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))
@@ -1,4 +1,5 @@
1
- :root, :host {
1
+ :root,
2
+ :host {
2
3
  --x-badge-border-width: 0px;
3
4
  --x-badge-border-radius: var(--radius-lg);
4
5
  --x-badge-font-size: var(--text-xs);
@@ -1,6 +1,7 @@
1
1
  .x-breadcrumb {
2
2
  > :where(ul, ol) {
3
- &, > li {
3
+ &,
4
+ > li {
4
5
  display: flex;
5
6
  align-items: center;
6
7
  }