@onereach/styles 27.0.2-beta.6110.0 → 27.0.2-beta.6112.0
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/MIGRATION_TAILWIND_V4.md +15 -26
- package/README.md +7 -6
- package/package.json +3 -3
- package/postcss/tailwind-v4-compat.cjs +64 -25
- package/tailwind/plugins/component-marker.js +22 -0
- package/tailwind/plugins/iconography.js +7 -3
- package/tailwind/plugins/layout.js +4 -2
- package/tailwind/plugins/theme-background.js +3 -2
- package/tailwind/plugins/theme-border.js +3 -2
- package/tailwind/plugins/theme-divider.js +3 -2
- package/tailwind/plugins/theme-foreground.js +3 -2
- package/tailwind/plugins/theme-outline.js +3 -2
- package/tailwind/plugins/theme-preset.js +9 -8
- package/tailwind/plugins/typography.js +5 -2
- package/tailwind.reference.css +4 -0
- package/main-v3.css +0 -9
package/MIGRATION_TAILWIND_V4.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Toolchain and config migration is required.
|
|
4
4
|
Template and Tailwind class rewrites are not required.
|
|
5
|
+
UI Next supports Tailwind CSS 4 at runtime; the Tailwind CSS 3 compiler is not
|
|
6
|
+
supported after the library upgrade.
|
|
5
7
|
|
|
6
8
|
Both `!class` and `class!` remain supported; `class!` is preferred for new code.
|
|
7
9
|
|
|
@@ -30,11 +32,11 @@ module.exports = {
|
|
|
30
32
|
};
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
The OneReach compatibility plugin runs after Tailwind CSS 4. It
|
|
34
|
-
established semantic-state importance, selector composition, and
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
The OneReach compatibility plugin runs after Tailwind CSS 4. It preserves the
|
|
36
|
+
established semantic-state importance, selector composition, and legacy cascade
|
|
37
|
+
order without changing template classes. Its nesting pass is scoped to generated
|
|
38
|
+
`@layer utilities` rules and does not transform application CSS outside that
|
|
39
|
+
layer.
|
|
38
40
|
|
|
39
41
|
## 3. Update the Tailwind config
|
|
40
42
|
|
|
@@ -67,6 +69,7 @@ The following example assumes this file is `src/tailwind.css` and the Tailwind
|
|
|
67
69
|
config is at the project root:
|
|
68
70
|
|
|
69
71
|
```css
|
|
72
|
+
@import "@onereach/styles/compat/tailwind-v3-utilities.css";
|
|
70
73
|
@import "tailwindcss";
|
|
71
74
|
@import "@onereach/styles/main-v4.css";
|
|
72
75
|
|
|
@@ -84,27 +87,14 @@ The application owns the `@import "tailwindcss"`, `@config`, and `@source`
|
|
|
84
87
|
directives. The `main-v4.css` entrypoint does not choose a consumer config or
|
|
85
88
|
source tree.
|
|
86
89
|
|
|
87
|
-
## 5.
|
|
90
|
+
## 5. Keep legacy `+` and `*` utilities
|
|
88
91
|
|
|
89
92
|
Tailwind CSS 4 rejects class candidates whose token names contain `+` or `*`.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
@import "tailwindcss";
|
|
96
|
-
@import "@onereach/styles/main-v4.css";
|
|
97
|
-
|
|
98
|
-
@config "../tailwind.config.cjs";
|
|
99
|
-
@source "./";
|
|
100
|
-
@source "../node_modules/@onereach/ui-components/dist/esm";
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
This import is optional and is not included by `main-v4.css`. It preserves the
|
|
104
|
-
legacy utility names without requiring template or class changes.
|
|
105
|
-
Import the compatibility stylesheet before `tailwindcss` so responsive
|
|
106
|
-
Tailwind utilities retain the same cascade precedence they had in Tailwind CSS
|
|
107
|
-
3.
|
|
93
|
+
UI Next components and existing consumers still use classes such as `px-sm+`,
|
|
94
|
+
`px-sm+*`, and `-m-sm+`, so the compatibility stylesheet in the standard
|
|
95
|
+
entrypoint is required. It is kept separate from `main-v4.css` because the
|
|
96
|
+
application owns import order. Import it before `tailwindcss` so responsive
|
|
97
|
+
utilities retain their established cascade precedence.
|
|
108
98
|
|
|
109
99
|
The artifact includes the legacy variant combinations used by UI Next and the
|
|
110
100
|
audited workspace consumers: important, dark, hover, mobile, desktop,
|
|
@@ -141,9 +131,8 @@ required.
|
|
|
141
131
|
|
|
142
132
|
- Replace Tailwind CSS 3 with Tailwind CSS 4 and `@tailwindcss/postcss`.
|
|
143
133
|
- Replace the preset import with `tailwind.config.preset.v4.js`.
|
|
134
|
+
- Import `@onereach/styles/compat/tailwind-v3-utilities.css` before Tailwind.
|
|
144
135
|
- Import `@onereach/styles/main-v4.css`.
|
|
145
136
|
- Move every Tailwind CSS 3 `content` path to an `@source` directive.
|
|
146
137
|
- Keep application theme extensions, plugins, utilities, and dark-mode roots.
|
|
147
|
-
- Add the optional compatibility import only when `+` or `*` token classes are
|
|
148
|
-
still present.
|
|
149
138
|
- Keep existing templates and Tailwind classes unchanged.
|
package/README.md
CHANGED
|
@@ -4,11 +4,12 @@ Shared UI Next design tokens, base styles, and Tailwind presets.
|
|
|
4
4
|
|
|
5
5
|
## Tailwind CSS
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
UI Next uses Tailwind CSS 4 at runtime. Use `main-v4.css` and
|
|
8
|
+
`tailwind.config.preset.v4.js`.
|
|
9
|
+
|
|
10
|
+
Existing template classes remain supported through the compatibility layer.
|
|
11
|
+
The Tailwind CSS 3 compiler is not supported.
|
|
11
12
|
|
|
12
13
|
See [Migrate to Tailwind CSS 4](./MIGRATION_TAILWIND_V4.md) for copyable
|
|
13
|
-
dependency, PostCSS, config, CSS, source-scanning, dark-mode, and
|
|
14
|
-
|
|
14
|
+
dependency, PostCSS, config, CSS, source-scanning, dark-mode, and legacy
|
|
15
|
+
utility compatibility setup.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/styles",
|
|
3
|
-
"version": "27.0.2-beta.
|
|
3
|
+
"version": "27.0.2-beta.6112.0",
|
|
4
4
|
"description": "Styles for or-ui-next",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"base.layer.css",
|
|
14
14
|
"font.css",
|
|
15
15
|
"legacy-ui-warning.scss",
|
|
16
|
-
"main-v3.css",
|
|
17
16
|
"main-v4.css",
|
|
18
17
|
"postcss",
|
|
19
18
|
"preflight-revert.css",
|
|
@@ -23,6 +22,7 @@
|
|
|
23
22
|
"tailwind.config.json",
|
|
24
23
|
"tailwind.config.preset.js",
|
|
25
24
|
"tailwind.config.preset.v4.js",
|
|
25
|
+
"tailwind.reference.css",
|
|
26
26
|
"temporary-dark-v2.css",
|
|
27
27
|
"tokens.css",
|
|
28
28
|
"tokens-v3.css",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"test:contract": "node --test tests/*.test.cjs"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@onereach/font-icons": "^27.0.2-beta.
|
|
44
|
+
"@onereach/font-icons": "^27.0.2-beta.6112.0",
|
|
45
45
|
"postcss-nested": "6.2.0",
|
|
46
46
|
"tailwindcss": "4.3.2"
|
|
47
47
|
},
|
|
@@ -10,6 +10,10 @@ const {
|
|
|
10
10
|
const {
|
|
11
11
|
legacySpacingAliasEntries,
|
|
12
12
|
} = require('../tailwind/compatibility/legacy-spacing');
|
|
13
|
+
const {
|
|
14
|
+
componentEndMarker,
|
|
15
|
+
componentMarker,
|
|
16
|
+
} = require('../tailwind/plugins/component-marker');
|
|
13
17
|
const coreVariants = require('../tailwind/plugins/core').variants;
|
|
14
18
|
const themePresetValues = require('../tailwind/plugins/theme-preset').values;
|
|
15
19
|
const spacing = require('../tailwind.config.preset.v4').theme.spacing;
|
|
@@ -48,6 +52,12 @@ const legacyTransformValue = [
|
|
|
48
52
|
'scaleY(var(--tw-scale-y, 1))',
|
|
49
53
|
].join(' ');
|
|
50
54
|
const legacyComponentFactories = [
|
|
55
|
+
['layout', require('../tailwind/plugins/layout').values],
|
|
56
|
+
['typography', require('../tailwind/plugins/typography').values],
|
|
57
|
+
['iconography', {
|
|
58
|
+
...require('../tailwind/plugins/iconography').values,
|
|
59
|
+
'onereach': 'onereach',
|
|
60
|
+
}],
|
|
51
61
|
['theme-outline', require('../tailwind/plugins/theme-outline').values],
|
|
52
62
|
['theme-background', require('../tailwind/plugins/theme-background').values],
|
|
53
63
|
['theme-foreground', require('../tailwind/plugins/theme-foreground').values],
|
|
@@ -63,20 +73,6 @@ const legacyComponentFactories = [
|
|
|
63
73
|
new Map(Object.keys(values).map((value, index) => [value, index])),
|
|
64
74
|
])
|
|
65
75
|
.sort(([left], [right]) => right.length - left.length);
|
|
66
|
-
const legacyComponentFactoryNames = [
|
|
67
|
-
'theme-background',
|
|
68
|
-
'theme-foreground',
|
|
69
|
-
'theme-preset-1',
|
|
70
|
-
'theme-preset-2',
|
|
71
|
-
'theme-preset-3',
|
|
72
|
-
'theme-preset-4',
|
|
73
|
-
'theme-divider',
|
|
74
|
-
'theme-outline',
|
|
75
|
-
'theme-border',
|
|
76
|
-
'iconography',
|
|
77
|
-
'typography',
|
|
78
|
-
'layout',
|
|
79
|
-
].sort((left, right) => right.length - left.length);
|
|
80
76
|
const legacyComponentFactoryOrder = new Map([
|
|
81
77
|
'layout',
|
|
82
78
|
'typography',
|
|
@@ -265,7 +261,10 @@ function utilityLayers(root) {
|
|
|
265
261
|
const layers = [];
|
|
266
262
|
|
|
267
263
|
root.walkAtRules('layer', (layer) => {
|
|
268
|
-
if (
|
|
264
|
+
if (
|
|
265
|
+
layer.params.trim() === 'utilities'
|
|
266
|
+
&& isTailwindGenerated(layer)
|
|
267
|
+
) layers.push(layer);
|
|
269
268
|
});
|
|
270
269
|
|
|
271
270
|
return layers;
|
|
@@ -275,12 +274,28 @@ function componentLayers(root) {
|
|
|
275
274
|
const layers = [];
|
|
276
275
|
|
|
277
276
|
root.walkAtRules('layer', (layer) => {
|
|
278
|
-
if (
|
|
277
|
+
if (
|
|
278
|
+
layer.params.trim() === 'components'
|
|
279
|
+
&& isTailwindGenerated(layer)
|
|
280
|
+
) layers.push(layer);
|
|
279
281
|
});
|
|
280
282
|
|
|
281
283
|
return layers;
|
|
282
284
|
}
|
|
283
285
|
|
|
286
|
+
function isTailwindGenerated(container) {
|
|
287
|
+
const sources = [container.source?.input?.file];
|
|
288
|
+
|
|
289
|
+
container.walk?.((node) => {
|
|
290
|
+
sources.push(node.source?.input?.file);
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
return sources.some((file) => (
|
|
294
|
+
typeof file === 'string'
|
|
295
|
+
&& file.replaceAll('\\', '/').endsWith('/tailwindcss/index.css')
|
|
296
|
+
));
|
|
297
|
+
}
|
|
298
|
+
|
|
284
299
|
function restoreLegacyComponentLayers(root) {
|
|
285
300
|
utilityLayers(root).forEach((utilityLayer) => {
|
|
286
301
|
const componentNodes = extractLegacyComponentNodes(utilityLayer);
|
|
@@ -302,8 +317,8 @@ function extractLegacyComponentNodes(container) {
|
|
|
302
317
|
if (node.type === 'rule') {
|
|
303
318
|
const isLegacyComponent = classNames(node.selector)
|
|
304
319
|
.map(baseUtility)
|
|
305
|
-
.some((utility) =>
|
|
306
|
-
|
|
320
|
+
.some((utility) => legacyComponentFactoryForUtility(utility))
|
|
321
|
+
&& removeComponentMarker(node);
|
|
307
322
|
|
|
308
323
|
if (!isLegacyComponent) return [];
|
|
309
324
|
|
|
@@ -332,6 +347,19 @@ function extractLegacyComponentNodes(container) {
|
|
|
332
347
|
});
|
|
333
348
|
}
|
|
334
349
|
|
|
350
|
+
function removeComponentMarker(container) {
|
|
351
|
+
let found = false;
|
|
352
|
+
|
|
353
|
+
[componentMarker, componentEndMarker].forEach((marker) => {
|
|
354
|
+
container.walkDecls(marker, (declaration) => {
|
|
355
|
+
found = true;
|
|
356
|
+
declaration.remove();
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
return found;
|
|
361
|
+
}
|
|
362
|
+
|
|
335
363
|
function reorderLegacyComponentValueSiblings(container) {
|
|
336
364
|
const groups = new Map();
|
|
337
365
|
|
|
@@ -345,8 +373,7 @@ function reorderLegacyComponentValueSiblings(container) {
|
|
|
345
373
|
}))
|
|
346
374
|
.map((entry) => ({
|
|
347
375
|
...entry,
|
|
348
|
-
factory:
|
|
349
|
-
.find(([factory]) => entry.utility.startsWith(`${factory}-`)),
|
|
376
|
+
factory: legacyComponentFactoryForUtility(entry.utility),
|
|
350
377
|
}))
|
|
351
378
|
.find(({ factory }) => factory);
|
|
352
379
|
|
|
@@ -399,8 +426,9 @@ function reorderLegacyComponentFactorySiblings(container) {
|
|
|
399
426
|
const selectorClassNames = selectors.flatMap(classNames);
|
|
400
427
|
const factory = selectorClassNames
|
|
401
428
|
.map(baseUtility)
|
|
402
|
-
.
|
|
403
|
-
|
|
429
|
+
.map(legacyComponentFactoryForUtility)
|
|
430
|
+
.filter(Boolean)
|
|
431
|
+
.map(([name]) => name)
|
|
404
432
|
.at(0);
|
|
405
433
|
|
|
406
434
|
if (!factory) return [];
|
|
@@ -487,7 +515,11 @@ function restoreLegacySpacingClassNames(root) {
|
|
|
487
515
|
|
|
488
516
|
restoredLegacyClass = true;
|
|
489
517
|
|
|
490
|
-
return
|
|
518
|
+
return [
|
|
519
|
+
`.${escapedClassName.slice(0, aliasStart)}`,
|
|
520
|
+
`-${escapeClassName(legacyName)}`,
|
|
521
|
+
escapedClassName.slice(aliasStart + alias.length + 1),
|
|
522
|
+
].join('');
|
|
491
523
|
},
|
|
492
524
|
);
|
|
493
525
|
|
|
@@ -871,7 +903,14 @@ function classNames(selector) {
|
|
|
871
903
|
}
|
|
872
904
|
|
|
873
905
|
function baseUtility(className) {
|
|
874
|
-
return className
|
|
906
|
+
return classSegments(className).at(-1).replace(/^!|!$/g, '');
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
function legacyComponentFactoryForUtility(utility) {
|
|
910
|
+
return legacyComponentFactories.find(([factory, values]) => (
|
|
911
|
+
utility.startsWith(`${factory}-`)
|
|
912
|
+
&& values.has(utility.slice(factory.length + 1))
|
|
913
|
+
));
|
|
875
914
|
}
|
|
876
915
|
|
|
877
916
|
function descendantContainers(rule) {
|
|
@@ -1088,7 +1127,7 @@ function responsiveVariantForNode(node) {
|
|
|
1088
1127
|
|
|
1089
1128
|
return selectors
|
|
1090
1129
|
.flatMap(classNames)
|
|
1091
|
-
.flatMap(
|
|
1130
|
+
.flatMap(classSegments)
|
|
1092
1131
|
.find((segment) => responsiveVariantOrder.has(segment));
|
|
1093
1132
|
}
|
|
1094
1133
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const componentMarker = '--or-tailwind-component';
|
|
2
|
+
const componentEndMarker = '--or-tailwind-component-end';
|
|
3
|
+
|
|
4
|
+
function markComponent(styles) {
|
|
5
|
+
if (Array.isArray(styles)) return styles.map(markComponent);
|
|
6
|
+
if (!styles || typeof styles !== 'object') return styles;
|
|
7
|
+
|
|
8
|
+
return Object.fromEntries([
|
|
9
|
+
[componentMarker, '1'],
|
|
10
|
+
...Object.entries(styles).map(([key, value]) => [
|
|
11
|
+
key,
|
|
12
|
+
markComponent(value),
|
|
13
|
+
]),
|
|
14
|
+
[componentEndMarker, '1'],
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = {
|
|
19
|
+
componentEndMarker,
|
|
20
|
+
componentMarker,
|
|
21
|
+
markComponent,
|
|
22
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const plugin = require('tailwindcss/plugin');
|
|
2
2
|
|
|
3
|
+
const { markComponent } = require('./component-marker');
|
|
4
|
+
|
|
3
5
|
const values = {
|
|
4
6
|
'outlined': '"opsz" 24, "wght" 400, "FILL" 0, "GRAD" 0',
|
|
5
7
|
'outlined-bold': '"opsz" 24, "wght" 700, "FILL" 0, "GRAD" 0',
|
|
@@ -11,18 +13,20 @@ const values = {
|
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
module.exports = {
|
|
16
|
+
values,
|
|
17
|
+
|
|
14
18
|
plugin: plugin(({ matchComponents, addComponents }) => {
|
|
15
19
|
matchComponents({
|
|
16
|
-
'iconography': (value) => ({
|
|
20
|
+
'iconography': (value) => markComponent({
|
|
17
21
|
fontFamily: '"Material Symbols Outlined"',
|
|
18
22
|
fontVariationSettings: value,
|
|
19
23
|
}),
|
|
20
24
|
}, { values });
|
|
21
25
|
|
|
22
26
|
addComponents({
|
|
23
|
-
'.iconography-onereach': {
|
|
27
|
+
'.iconography-onereach': markComponent({
|
|
24
28
|
fontFamily: '"OneReach Icons"',
|
|
25
|
-
},
|
|
29
|
+
}),
|
|
26
30
|
});
|
|
27
31
|
}),
|
|
28
32
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const plugin = require('tailwindcss/plugin');
|
|
2
2
|
|
|
3
|
+
const { markComponent } = require('./component-marker');
|
|
4
|
+
|
|
3
5
|
const values = {
|
|
4
6
|
'row': 'row',
|
|
5
7
|
'row-reverse': 'row-reverse',
|
|
@@ -22,7 +24,7 @@ module.exports = {
|
|
|
22
24
|
'layout': (value) => {
|
|
23
25
|
const { prefix = '', direction, suffix = '' } = /^(?:(?<prefix>inline-)\.\.)?(?<direction>row|column)(?<suffix>-reverse)?$/.exec(value).groups;
|
|
24
26
|
|
|
25
|
-
return {
|
|
27
|
+
return markComponent({
|
|
26
28
|
flexGrow: prefix === 'inline-' ? '0' : null,
|
|
27
29
|
flexShrink: prefix === 'inline-' ? '0' : null,
|
|
28
30
|
flexBasis: prefix === 'inline-' ? 'auto' : null,
|
|
@@ -37,7 +39,7 @@ module.exports = {
|
|
|
37
39
|
|
|
38
40
|
minWidth: prefix === 'inline-' ? 'auto' : null,
|
|
39
41
|
maxWidth: prefix === 'inline-' ? '100%' : null,
|
|
40
|
-
};
|
|
42
|
+
});
|
|
41
43
|
},
|
|
42
44
|
}, { values });
|
|
43
45
|
}),
|
|
@@ -3,6 +3,7 @@ const plugin = require('tailwindcss/plugin');
|
|
|
3
3
|
const { markImportant } = require('../compatibility/important');
|
|
4
4
|
const { resolveThemeValue } = require('../utils');
|
|
5
5
|
|
|
6
|
+
const { markComponent } = require('./component-marker');
|
|
6
7
|
const { variants } = require('./core');
|
|
7
8
|
|
|
8
9
|
const values = {
|
|
@@ -201,7 +202,7 @@ module.exports = {
|
|
|
201
202
|
'theme-background': (value) => {
|
|
202
203
|
const [token, suffix = ''] = value.split('..');
|
|
203
204
|
|
|
204
|
-
return {
|
|
205
|
+
return markComponent({
|
|
205
206
|
backgroundColor: resolveThemeValue(theme, `backgroundColor.${token}` + suffix, token),
|
|
206
207
|
|
|
207
208
|
[variants['disabled']]: ['white', 'black', 'transparent'].includes(token) ? null : markImportant({
|
|
@@ -211,7 +212,7 @@ module.exports = {
|
|
|
211
212
|
transitionProperty: 'color, background-color, border-color, outline-color',
|
|
212
213
|
transitionDuration: theme('transitionDuration.short'),
|
|
213
214
|
transitionTimingFunction: theme('transitionTimingFunction.standard'),
|
|
214
|
-
};
|
|
215
|
+
});
|
|
215
216
|
},
|
|
216
217
|
}, { values });
|
|
217
218
|
}),
|
|
@@ -3,6 +3,7 @@ const plugin = require('tailwindcss/plugin');
|
|
|
3
3
|
const { markImportant } = require('../compatibility/important');
|
|
4
4
|
const { resolveThemeValue } = require('../utils');
|
|
5
5
|
|
|
6
|
+
const { markComponent } = require('./component-marker');
|
|
6
7
|
const { variants } = require('./core');
|
|
7
8
|
|
|
8
9
|
const values = {
|
|
@@ -51,7 +52,7 @@ module.exports = {
|
|
|
51
52
|
'theme-border': (value) => {
|
|
52
53
|
const [token, suffix = ''] = value.split('..');
|
|
53
54
|
|
|
54
|
-
return {
|
|
55
|
+
return markComponent({
|
|
55
56
|
borderStyle: 'solid',
|
|
56
57
|
borderColor: resolveThemeValue(theme, `borderColor.${token}` + suffix, token),
|
|
57
58
|
|
|
@@ -62,7 +63,7 @@ module.exports = {
|
|
|
62
63
|
transitionProperty: 'color, background-color, border-color, outline-color',
|
|
63
64
|
transitionDuration: theme('transitionDuration.short'),
|
|
64
65
|
transitionTimingFunction: theme('transitionTimingFunction.standard'),
|
|
65
|
-
};
|
|
66
|
+
});
|
|
66
67
|
},
|
|
67
68
|
}, { values });
|
|
68
69
|
}),
|
|
@@ -3,6 +3,7 @@ const plugin = require('tailwindcss/plugin');
|
|
|
3
3
|
const { markImportant } = require('../compatibility/important');
|
|
4
4
|
const { resolveThemeValue } = require('../utils');
|
|
5
5
|
|
|
6
|
+
const { markComponent } = require('./component-marker');
|
|
6
7
|
const { variants } = require('./core');
|
|
7
8
|
|
|
8
9
|
const values = {
|
|
@@ -51,7 +52,7 @@ module.exports = {
|
|
|
51
52
|
'theme-divider': (value) => {
|
|
52
53
|
const [token, suffix = ''] = value.split('..');
|
|
53
54
|
|
|
54
|
-
return {
|
|
55
|
+
return markComponent({
|
|
55
56
|
[variants['children']]: {
|
|
56
57
|
'&:not(:first-child)': markImportant({
|
|
57
58
|
borderInlineStartStyle: 'none',
|
|
@@ -75,7 +76,7 @@ module.exports = {
|
|
|
75
76
|
}),
|
|
76
77
|
},
|
|
77
78
|
},
|
|
78
|
-
};
|
|
79
|
+
});
|
|
79
80
|
},
|
|
80
81
|
}, { values });
|
|
81
82
|
}),
|
|
@@ -3,6 +3,7 @@ const plugin = require('tailwindcss/plugin');
|
|
|
3
3
|
const { markImportant } = require('../compatibility/important');
|
|
4
4
|
const { resolveThemeValue } = require('../utils');
|
|
5
5
|
|
|
6
|
+
const { markComponent } = require('./component-marker');
|
|
6
7
|
const { variants } = require('./core');
|
|
7
8
|
|
|
8
9
|
const values = {
|
|
@@ -198,7 +199,7 @@ module.exports = {
|
|
|
198
199
|
'theme-foreground': (value) => {
|
|
199
200
|
const [token, suffix = ''] = value.split('..');
|
|
200
201
|
|
|
201
|
-
return {
|
|
202
|
+
return markComponent({
|
|
202
203
|
color: resolveThemeValue(theme, `textColor.${token}` + suffix, token),
|
|
203
204
|
|
|
204
205
|
[variants['disabled']]: ['white', 'black', 'transparent'].includes(token) ? null : markImportant({
|
|
@@ -208,7 +209,7 @@ module.exports = {
|
|
|
208
209
|
transitionProperty: 'color, background-color, border-color, outline-color',
|
|
209
210
|
transitionDuration: theme('transitionDuration.short'),
|
|
210
211
|
transitionTimingFunction: theme('transitionTimingFunction.standard'),
|
|
211
|
-
};
|
|
212
|
+
});
|
|
212
213
|
},
|
|
213
214
|
}, { values });
|
|
214
215
|
}),
|
|
@@ -3,6 +3,7 @@ const plugin = require('tailwindcss/plugin');
|
|
|
3
3
|
const { markImportant } = require('../compatibility/important');
|
|
4
4
|
const { resolveThemeValue } = require('../utils');
|
|
5
5
|
|
|
6
|
+
const { markComponent } = require('./component-marker');
|
|
6
7
|
const { variants } = require('./core');
|
|
7
8
|
|
|
8
9
|
const values = {
|
|
@@ -42,7 +43,7 @@ module.exports = {
|
|
|
42
43
|
'theme-outline': (value) => {
|
|
43
44
|
const [token, suffix = ''] = value.split('..');
|
|
44
45
|
|
|
45
|
-
return {
|
|
46
|
+
return markComponent({
|
|
46
47
|
outlineStyle: 'solid',
|
|
47
48
|
outlineColor: resolveThemeValue(theme, `outlineColor.${token}` + suffix, token),
|
|
48
49
|
|
|
@@ -53,7 +54,7 @@ module.exports = {
|
|
|
53
54
|
transitionProperty: 'color, background-color, border-color, outline-color',
|
|
54
55
|
transitionDuration: theme('transitionDuration.short'),
|
|
55
56
|
transitionTimingFunction: theme('transitionTimingFunction.standard'),
|
|
56
|
-
};
|
|
57
|
+
});
|
|
57
58
|
},
|
|
58
59
|
}, { values });
|
|
59
60
|
}),
|
|
@@ -3,6 +3,7 @@ const plugin = require('tailwindcss/plugin');
|
|
|
3
3
|
const { markImportant } = require('../compatibility/important');
|
|
4
4
|
const { resolveThemeValue } = require('../utils');
|
|
5
5
|
|
|
6
|
+
const { markComponent } = require('./component-marker');
|
|
6
7
|
const { variants } = require('./core');
|
|
7
8
|
|
|
8
9
|
const values = {
|
|
@@ -33,7 +34,7 @@ module.exports = {
|
|
|
33
34
|
'theme-preset-1': (value) => {
|
|
34
35
|
const [token, suffix = ''] = value.split('..');
|
|
35
36
|
|
|
36
|
-
return {
|
|
37
|
+
return markComponent({
|
|
37
38
|
color: resolveThemeValue(theme, `textColor.on-${token}` + suffix),
|
|
38
39
|
backgroundColor: resolveThemeValue(theme, `backgroundColor.${token}` + suffix),
|
|
39
40
|
|
|
@@ -68,13 +69,13 @@ module.exports = {
|
|
|
68
69
|
transitionProperty: 'color, background-color, border-color, outline-color',
|
|
69
70
|
transitionDuration: theme('transitionDuration.short'),
|
|
70
71
|
transitionTimingFunction: theme('transitionTimingFunction.standard'),
|
|
71
|
-
};
|
|
72
|
+
});
|
|
72
73
|
},
|
|
73
74
|
|
|
74
75
|
'theme-preset-2': (value) => {
|
|
75
76
|
const [token, suffix = ''] = value.split('..');
|
|
76
77
|
|
|
77
|
-
return {
|
|
78
|
+
return markComponent({
|
|
78
79
|
color: resolveThemeValue(theme, `textColor.${token}` + suffix),
|
|
79
80
|
backgroundColor: resolveThemeValue(theme, `backgroundColor.${token}-opacity-0-08` + suffix),
|
|
80
81
|
|
|
@@ -109,13 +110,13 @@ module.exports = {
|
|
|
109
110
|
transitionProperty: 'color, background-color, border-color, outline-color',
|
|
110
111
|
transitionDuration: theme('transitionDuration.short'),
|
|
111
112
|
transitionTimingFunction: theme('transitionTimingFunction.standard'),
|
|
112
|
-
};
|
|
113
|
+
});
|
|
113
114
|
},
|
|
114
115
|
|
|
115
116
|
'theme-preset-3': (value) => {
|
|
116
117
|
const [token, suffix = ''] = value.split('..');
|
|
117
118
|
|
|
118
|
-
return {
|
|
119
|
+
return markComponent({
|
|
119
120
|
color: resolveThemeValue(theme, `textColor.${token}` + suffix),
|
|
120
121
|
backgroundColor: 'transparent',
|
|
121
122
|
|
|
@@ -150,13 +151,13 @@ module.exports = {
|
|
|
150
151
|
transitionProperty: 'color, background-color, border-color, outline-color',
|
|
151
152
|
transitionDuration: theme('transitionDuration.short'),
|
|
152
153
|
transitionTimingFunction: theme('transitionTimingFunction.standard'),
|
|
153
|
-
};
|
|
154
|
+
});
|
|
154
155
|
},
|
|
155
156
|
|
|
156
157
|
'theme-preset-4': (value) => {
|
|
157
158
|
const [token, suffix = ''] = value.split('..');
|
|
158
159
|
|
|
159
|
-
return {
|
|
160
|
+
return markComponent({
|
|
160
161
|
color: resolveThemeValue(theme, `textColor.${token}` + suffix),
|
|
161
162
|
backgroundColor: 'transparent',
|
|
162
163
|
|
|
@@ -191,7 +192,7 @@ module.exports = {
|
|
|
191
192
|
transitionProperty: 'color, background-color, border-color, outline-color',
|
|
192
193
|
transitionDuration: theme('transitionDuration.short'),
|
|
193
194
|
transitionTimingFunction: theme('transitionTimingFunction.standard'),
|
|
194
|
-
};
|
|
195
|
+
});
|
|
195
196
|
},
|
|
196
197
|
}, { values });
|
|
197
198
|
}),
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
2
3
|
const screens = require('../../screens.json');
|
|
3
4
|
|
|
5
|
+
const { markComponent } = require('./component-marker');
|
|
6
|
+
|
|
4
7
|
const values = {
|
|
5
8
|
'display-large': 'display-large',
|
|
6
9
|
'display-medium': 'display-medium',
|
|
@@ -39,7 +42,7 @@ module.exports = {
|
|
|
39
42
|
const [fontSizeDesktop, optionsDesktop] = fontSizeConfig[value] ?? [];
|
|
40
43
|
const [fontSizeMobile, optionsMobile] = fontSizeConfig[`mobile-${value}`] ?? [];
|
|
41
44
|
|
|
42
|
-
return {
|
|
45
|
+
return markComponent({
|
|
43
46
|
fontFamily: theme(`fontFamily.mobile-${value}`) ?? theme(`fontFamily.${value}`),
|
|
44
47
|
fontWeight: theme(`fontWeight.mobile-${value}`) ?? theme(`fontWeight.${value}`),
|
|
45
48
|
fontSize: fontSizeMobile ?? fontSizeDesktop,
|
|
@@ -66,7 +69,7 @@ module.exports = {
|
|
|
66
69
|
fontSize: fontSizeDesktop,
|
|
67
70
|
lineHeight: optionsDesktop?.lineHeight,
|
|
68
71
|
},
|
|
69
|
-
};
|
|
72
|
+
});
|
|
70
73
|
},
|
|
71
74
|
}, { values });
|
|
72
75
|
}),
|
package/main-v3.css
DELETED