@onereach/styles 3.1.0 → 3.1.1-beta.3176.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/package.json +3 -4
- package/tailwind/plugins/core.js +69 -0
- package/tailwind/plugins/iconography.js +22 -0
- package/tailwind/plugins/interactivity.js +26 -0
- package/tailwind/plugins/layout.js +39 -0
- package/tailwind/plugins/theme-background.js +140 -0
- package/tailwind/plugins/theme-border.js +104 -0
- package/tailwind/plugins/theme-foreground.js +146 -0
- package/tailwind/plugins/theme-outline.js +70 -0
- package/tailwind/plugins/theme-preset.js +197 -0
- package/tailwind/plugins/typography.js +58 -0
- package/tailwind.config.json +4 -0
- package/tailwind.config.preset.js +23 -896
- /package/{tailwind-utils.js → tailwind/utils.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/styles",
|
|
3
|
-
"version": "3.1.0",
|
|
3
|
+
"version": "3.1.1-beta.3176.0",
|
|
4
4
|
"description": "Styles for or-ui-next",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "./main.css",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"dist",
|
|
11
11
|
"src",
|
|
12
12
|
"icons",
|
|
13
|
+
"tailwind/**",
|
|
13
14
|
"main.css",
|
|
14
15
|
"rollup-plugin-tailwindcss-cli.css",
|
|
15
16
|
"tw-color-variables.css",
|
|
@@ -18,7 +19,6 @@
|
|
|
18
19
|
"tailwind.config.js",
|
|
19
20
|
"tailwind.config.json",
|
|
20
21
|
"tailwind.config.preset.js",
|
|
21
|
-
"tailwind-utils.js",
|
|
22
22
|
"tokens.css",
|
|
23
23
|
"main-v3.css",
|
|
24
24
|
"font.css",
|
|
@@ -58,6 +58,5 @@
|
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
|
-
}
|
|
62
|
-
"gitHead": "f33688dd9302588085b19a107cbb992847e9d0f1"
|
|
61
|
+
}
|
|
63
62
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
3
|
+
const enabledSelectors = ['&:not([disabled])'];
|
|
4
|
+
const disabledSelectors = ['&[disabled]'];
|
|
5
|
+
|
|
6
|
+
const readWriteSelectors = ['&:not([readonly])'];
|
|
7
|
+
const readOnlySelectors = ['&[readonly]'];
|
|
8
|
+
|
|
9
|
+
const validSelectors = ['&:not([invalid])'];
|
|
10
|
+
const invalidSelectors = ['&[invalid]'];
|
|
11
|
+
|
|
12
|
+
const requiredSelectors = ['&[required]'];
|
|
13
|
+
const optionalSelectors = ['&:not([required])'];
|
|
14
|
+
|
|
15
|
+
module.exports = {
|
|
16
|
+
plugin: plugin(({ addVariant, addUtilities }) => {
|
|
17
|
+
addVariant('enabled', enabledSelectors);
|
|
18
|
+
addVariant('disabled', disabledSelectors);
|
|
19
|
+
|
|
20
|
+
addVariant('read-write', readWriteSelectors);
|
|
21
|
+
addVariant('read-only', readOnlySelectors);
|
|
22
|
+
|
|
23
|
+
addVariant('valid', validSelectors);
|
|
24
|
+
addVariant('invalid', invalidSelectors);
|
|
25
|
+
|
|
26
|
+
addVariant('required', requiredSelectors);
|
|
27
|
+
addVariant('optional', optionalSelectors);
|
|
28
|
+
|
|
29
|
+
addVariant('checked', ['&[checked]', '&:checked']);
|
|
30
|
+
addVariant('selected', ['&[selected]', '&:checked']);
|
|
31
|
+
addVariant('activated', ['&[activated]']);
|
|
32
|
+
|
|
33
|
+
addVariant('hover', [
|
|
34
|
+
'&:not(.interactivity-none):hover',
|
|
35
|
+
'&:not(.interactivity-none)[force-state="hover"]',
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
addVariant('focus', [
|
|
39
|
+
'&:not(.interactivity-none):focus-visible',
|
|
40
|
+
'&:not(.interactivity-none)[force-state="focus"]',
|
|
41
|
+
]);
|
|
42
|
+
|
|
43
|
+
addVariant('focus-within', [
|
|
44
|
+
'&:not(.interactivity-none):focus-within',
|
|
45
|
+
'&:not(.interactivity-none)[force-state="focus-within"]',
|
|
46
|
+
]);
|
|
47
|
+
|
|
48
|
+
addVariant('active', [
|
|
49
|
+
'&:not(.interactivity-none):active',
|
|
50
|
+
'&:not(.interactivity-none)[force-state="active"]',
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
addVariant('children', ['& > *']);
|
|
54
|
+
addVariant('first-child', ['& > *:first-child']);
|
|
55
|
+
addVariant('intermediate-child', ['& > *:not(:first-child):not(:last-child)']);
|
|
56
|
+
addVariant('last-child', ['& > *:last-child']);
|
|
57
|
+
|
|
58
|
+
addVariant('links', ['& :any-link']);
|
|
59
|
+
|
|
60
|
+
// TODO: Remove when migration complete
|
|
61
|
+
addUtilities({
|
|
62
|
+
'.visually-hidden': {
|
|
63
|
+
width: 0,
|
|
64
|
+
height: 0,
|
|
65
|
+
visibility: 'hidden',
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
3
|
+
const values = {
|
|
4
|
+
'outlined': '"opsz" 24, "wght" 400, "FILL" 0, "GRAD" 0',
|
|
5
|
+
'outlined-bold': '"opsz" 24, "wght" 700, "FILL" 0, "GRAD" 0',
|
|
6
|
+
|
|
7
|
+
'filled': '"opsz" 24, "wght" 400, "FILL" 1, "GRAD" 0',
|
|
8
|
+
'filled-bold': '"opsz" 24, "wght" 700, "FILL" 1, "GRAD" 0',
|
|
9
|
+
|
|
10
|
+
'inherit': 'inherit',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports = {
|
|
14
|
+
plugin: plugin(({ matchUtilities }) => {
|
|
15
|
+
matchUtilities({
|
|
16
|
+
'iconography': (value) => ({
|
|
17
|
+
fontFamily: '"Material Symbols Outlined"',
|
|
18
|
+
fontVariationSettings: value,
|
|
19
|
+
}),
|
|
20
|
+
}, { values });
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
plugin: plugin(({ addUtilities }) => {
|
|
5
|
+
addUtilities({
|
|
6
|
+
'.interactivity-auto': {
|
|
7
|
+
pointerEvents: 'auto',
|
|
8
|
+
cursor: 'pointer',
|
|
9
|
+
|
|
10
|
+
'&[disabled]': {
|
|
11
|
+
pointerEvents: 'none',
|
|
12
|
+
cursor: 'default',
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
userSelect: 'none',
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
'.interactivity-none': {
|
|
19
|
+
pointerEvents: 'none',
|
|
20
|
+
cursor: 'default',
|
|
21
|
+
|
|
22
|
+
userSelect: 'none',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
3
|
+
const values = {
|
|
4
|
+
'row': 'row',
|
|
5
|
+
'row-reverse': 'row-reverse',
|
|
6
|
+
|
|
7
|
+
'column': 'column',
|
|
8
|
+
'column-reverse': 'column-reverse',
|
|
9
|
+
|
|
10
|
+
'inline-row': 'inline-..row',
|
|
11
|
+
'inline-row-reverse': 'inline-..row-reverse',
|
|
12
|
+
|
|
13
|
+
'inline-column': 'inline-..column',
|
|
14
|
+
'inline-column-reverse': 'inline-..column-reverse',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
values,
|
|
19
|
+
|
|
20
|
+
plugin: plugin(({ matchUtilities }) => {
|
|
21
|
+
matchUtilities({
|
|
22
|
+
'layout': (value) => {
|
|
23
|
+
const { prefix = '', direction } = /^(?:(?<prefix>inline-)\.\.)?(?<direction>.+)$/.exec(value).groups;
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
display: prefix + 'flex',
|
|
27
|
+
|
|
28
|
+
flexFlow: `${direction} nowrap`,
|
|
29
|
+
flex: prefix === 'inline-' ? '0 0 auto' : undefined,
|
|
30
|
+
|
|
31
|
+
alignContent: direction === 'row' ? 'center' : undefined,
|
|
32
|
+
alignItems: direction === 'row' ? 'center' : undefined,
|
|
33
|
+
|
|
34
|
+
maxWidth: prefix === 'inline-' ? '100%' : undefined,
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
}, { values });
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
3
|
+
const values = {
|
|
4
|
+
'base': 'white',
|
|
5
|
+
'base-dark': 'black',
|
|
6
|
+
|
|
7
|
+
'default': 'background',
|
|
8
|
+
'default-dark': 'background..-dark',
|
|
9
|
+
|
|
10
|
+
'disabled': 'disabled',
|
|
11
|
+
'disabled-dark': 'disabled..-dark',
|
|
12
|
+
|
|
13
|
+
'overlay': 'overlay',
|
|
14
|
+
'overlay-dark': 'overlay..-dark',
|
|
15
|
+
|
|
16
|
+
'primary': 'primary',
|
|
17
|
+
'primary-dark': 'primary..-dark',
|
|
18
|
+
|
|
19
|
+
'secondary': 'secondary',
|
|
20
|
+
'secondary-dark': 'secondary..-dark',
|
|
21
|
+
|
|
22
|
+
'tertiary': 'tertiary',
|
|
23
|
+
'tertiary-dark': 'tertiary..-dark',
|
|
24
|
+
|
|
25
|
+
'success': 'success',
|
|
26
|
+
'success-dark': 'success..-dark',
|
|
27
|
+
|
|
28
|
+
'warning': 'warning',
|
|
29
|
+
'warning-dark': 'warning..-dark',
|
|
30
|
+
|
|
31
|
+
'error': 'error',
|
|
32
|
+
'error-dark': 'error..-dark',
|
|
33
|
+
|
|
34
|
+
'primary-hover': 'primary-hover',
|
|
35
|
+
'primary-hover-dark': 'primary-hover..-dark',
|
|
36
|
+
|
|
37
|
+
// 'secondary-hover': 'secondary-hover',
|
|
38
|
+
// 'secondary-hover-dark': 'secondary-hover..-dark',
|
|
39
|
+
|
|
40
|
+
// 'tertiary-hover': 'tertiary-hover',
|
|
41
|
+
// 'tertiary-hover-dark': 'tertiary-hover..-dark',
|
|
42
|
+
|
|
43
|
+
'success-hover': 'success-hover',
|
|
44
|
+
'success-hover-dark': 'success-hover..-dark',
|
|
45
|
+
|
|
46
|
+
'warning-hover': 'warning-hover',
|
|
47
|
+
'warning-hover-dark': 'warning-hover..-dark',
|
|
48
|
+
|
|
49
|
+
'error-hover': 'error-hover',
|
|
50
|
+
'error-hover-dark': 'error-hover..-dark',
|
|
51
|
+
|
|
52
|
+
'primary-translucent': 'primary-opacity-0-08',
|
|
53
|
+
'primary-translucent-dark': 'primary-opacity-0-08..-dark',
|
|
54
|
+
|
|
55
|
+
// 'secondary-translucent': 'secondary-opacity-0-08',
|
|
56
|
+
// 'secondary-translucent-dark': 'secondary-opacity-0-08..-dark',
|
|
57
|
+
|
|
58
|
+
// 'tertiary-translucent': 'tertiary-opacity-0-08',
|
|
59
|
+
// 'tertiary-translucent-dark': 'tertiary-opacity-0-08..-dark',
|
|
60
|
+
|
|
61
|
+
'success-translucent': 'success-opacity-0-08',
|
|
62
|
+
'success-translucent-dark': 'success-opacity-0-08..-dark',
|
|
63
|
+
|
|
64
|
+
'warning-translucent': 'warning-opacity-0-08',
|
|
65
|
+
'warning-translucent-dark': 'warning-opacity-0-08..-dark',
|
|
66
|
+
|
|
67
|
+
'error-translucent': 'error-opacity-0-08',
|
|
68
|
+
'error-translucent-dark': 'error-opacity-0-08..-dark',
|
|
69
|
+
|
|
70
|
+
'primary-container': 'primary-container',
|
|
71
|
+
'primary-container-dark': 'primary-container..-dark',
|
|
72
|
+
|
|
73
|
+
'secondary-container': 'secondary-container',
|
|
74
|
+
'secondary-container-dark': 'secondary-container..-dark',
|
|
75
|
+
|
|
76
|
+
'tertiary-container': 'tertiary-container',
|
|
77
|
+
'tertiary-container-dark': 'tertiary-container..-dark',
|
|
78
|
+
|
|
79
|
+
'success-container': 'success-container',
|
|
80
|
+
'success-container-dark': 'success-container..-dark',
|
|
81
|
+
|
|
82
|
+
'warning-container': 'warning-container',
|
|
83
|
+
'warning-container-dark': 'warning-container..-dark',
|
|
84
|
+
|
|
85
|
+
'error-container': 'error-container',
|
|
86
|
+
'error-container-dark': 'error-container..-dark',
|
|
87
|
+
|
|
88
|
+
'surface': 'surface',
|
|
89
|
+
'surface-dark': 'surface..-dark',
|
|
90
|
+
|
|
91
|
+
'surface-1': 'surface-1',
|
|
92
|
+
'surface-1-dark': 'surface-1..-dark',
|
|
93
|
+
|
|
94
|
+
'surface-2': 'surface-2',
|
|
95
|
+
'surface-2-dark': 'surface-2..-dark',
|
|
96
|
+
|
|
97
|
+
'surface-3': 'surface-3',
|
|
98
|
+
'surface-3-dark': 'surface-3..-dark',
|
|
99
|
+
|
|
100
|
+
'surface-4': 'surface-4',
|
|
101
|
+
'surface-4-dark': 'surface-4..-dark',
|
|
102
|
+
|
|
103
|
+
'surface-5': 'surface-5',
|
|
104
|
+
'surface-5-dark': 'surface-5..-dark',
|
|
105
|
+
|
|
106
|
+
'surface-variant': 'surface-variant',
|
|
107
|
+
'surface-variant-dark': 'surface-variant..-dark',
|
|
108
|
+
|
|
109
|
+
'surface-inverse': 'inverse-surface',
|
|
110
|
+
'surface-inverse-dark': 'inverse-surface..-dark',
|
|
111
|
+
|
|
112
|
+
'transparent': 'transparent',
|
|
113
|
+
'transparent-dark': 'transparent..-dark',
|
|
114
|
+
|
|
115
|
+
'current': 'current',
|
|
116
|
+
'current-dark': 'current..-dark',
|
|
117
|
+
|
|
118
|
+
'inherit': 'inherit',
|
|
119
|
+
'inherit-dark': 'inherit..-dark',
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
module.exports = {
|
|
123
|
+
values,
|
|
124
|
+
|
|
125
|
+
plugin: plugin(({ matchUtilities, theme }) => {
|
|
126
|
+
matchUtilities({
|
|
127
|
+
'theme-background': (value) => {
|
|
128
|
+
const [token, suffix = ''] = value.split('..');
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
backgroundColor: theme(`backgroundColor.${token}` + suffix, token),
|
|
132
|
+
|
|
133
|
+
'&[disabled]': {
|
|
134
|
+
backgroundColor: `${theme('backgroundColor.disabled' + suffix)} !important`,
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
}, { values });
|
|
139
|
+
}),
|
|
140
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
3
|
+
const values = {
|
|
4
|
+
'outline': 'outline',
|
|
5
|
+
'outline-dark': 'outline..-dark',
|
|
6
|
+
|
|
7
|
+
'outline-variant': 'outline-variant',
|
|
8
|
+
'outline-variant-dark': 'outline-variant..-dark',
|
|
9
|
+
|
|
10
|
+
'primary': 'primary',
|
|
11
|
+
'primary-dark': 'primary..-dark',
|
|
12
|
+
|
|
13
|
+
'secondary': 'secondary',
|
|
14
|
+
'secondary-dark': 'secondary..-dark',
|
|
15
|
+
|
|
16
|
+
'tertiary': 'tertiary',
|
|
17
|
+
'tertiary-dark': 'tertiary..-dark',
|
|
18
|
+
|
|
19
|
+
'success': 'success',
|
|
20
|
+
'success-dark': 'success..-dark',
|
|
21
|
+
|
|
22
|
+
'warning': 'warning',
|
|
23
|
+
'warning-dark': 'warning..-dark',
|
|
24
|
+
|
|
25
|
+
'error': 'error',
|
|
26
|
+
'error-dark': 'error..-dark',
|
|
27
|
+
|
|
28
|
+
'primary-translucent': 'primary-opacity-0-16',
|
|
29
|
+
'primary-translucent-dark': 'primary-opacity-0-16..-dark',
|
|
30
|
+
|
|
31
|
+
// 'secondary-translucent': 'secondary-opacity-0-16',
|
|
32
|
+
// 'secondary-translucent-dark': 'secondary-opacity-0-16..-dark',
|
|
33
|
+
|
|
34
|
+
// 'tertiary-translucent': 'tertiary-opacity-0-16',
|
|
35
|
+
// 'tertiary-translucent-dark': 'tertiary-opacity-0-16..-dark',
|
|
36
|
+
|
|
37
|
+
'success-translucent': 'success-opacity-0-16',
|
|
38
|
+
'success-translucent-dark': 'success-opacity-0-16..-dark',
|
|
39
|
+
|
|
40
|
+
'warning-translucent': 'warning-opacity-0-16',
|
|
41
|
+
'warning-translucent-dark': 'warning-opacity-0-16..-dark',
|
|
42
|
+
|
|
43
|
+
'error-translucent': 'error-opacity-0-16',
|
|
44
|
+
'error-translucent-dark': 'error-opacity-0-16..-dark',
|
|
45
|
+
|
|
46
|
+
'transparent': 'transparent',
|
|
47
|
+
'transparent-dark': 'transparent..-dark',
|
|
48
|
+
|
|
49
|
+
'current': 'current',
|
|
50
|
+
'current-dark': 'current..-dark',
|
|
51
|
+
|
|
52
|
+
'inherit': 'inherit',
|
|
53
|
+
'inherit-dark': 'inherit..-dark',
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
module.exports = {
|
|
57
|
+
values,
|
|
58
|
+
|
|
59
|
+
plugin: plugin(({ matchUtilities, addUtilities, theme }) => {
|
|
60
|
+
matchUtilities({
|
|
61
|
+
'theme-border-1': (value) => {
|
|
62
|
+
const [token, suffix = ''] = value.split('..');
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
borderWidth: theme('borderWidth.1'),
|
|
66
|
+
borderStyle: 'solid',
|
|
67
|
+
borderColor: theme(`borderColor.${token}` + suffix, token),
|
|
68
|
+
|
|
69
|
+
'&[disabled]': {
|
|
70
|
+
borderColor: `${theme('borderColor.disabled' + suffix)} !important`,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
}, { values });
|
|
75
|
+
|
|
76
|
+
matchUtilities({
|
|
77
|
+
'theme-border-2': (value) => {
|
|
78
|
+
const [token, suffix = ''] = value.split('..');
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
borderWidth: theme('borderWidth.2'),
|
|
82
|
+
borderStyle: 'solid',
|
|
83
|
+
borderColor: theme(`borderColor.${token}` + suffix, token),
|
|
84
|
+
|
|
85
|
+
'&[disabled]': {
|
|
86
|
+
borderColor: `${theme('borderColor.disabled' + suffix)} !important`,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
}, { values });
|
|
91
|
+
|
|
92
|
+
addUtilities({
|
|
93
|
+
'.theme-border-overline': {
|
|
94
|
+
borderStyle: 'none !important',
|
|
95
|
+
borderTopStyle: 'solid !important',
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
'.theme-border-underline': {
|
|
99
|
+
borderStyle: 'none !important',
|
|
100
|
+
borderBottomStyle: 'solid !important',
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
3
|
+
const values = {
|
|
4
|
+
'base': 'white',
|
|
5
|
+
'base-dark': 'black',
|
|
6
|
+
|
|
7
|
+
'default': 'on-background',
|
|
8
|
+
'default-dark': 'on-background..-dark',
|
|
9
|
+
|
|
10
|
+
'disabled': 'on-disabled',
|
|
11
|
+
'disabled-dark': 'on-disabled..-dark',
|
|
12
|
+
|
|
13
|
+
'outline': 'outline',
|
|
14
|
+
'outline-dark': 'outline..-dark',
|
|
15
|
+
|
|
16
|
+
'outline-variant': 'outline-variant',
|
|
17
|
+
'outline-variant-dark': 'outline-variant..-dark',
|
|
18
|
+
|
|
19
|
+
'primary': 'primary',
|
|
20
|
+
'primary-dark': 'primary..-dark',
|
|
21
|
+
|
|
22
|
+
'secondary': 'secondary',
|
|
23
|
+
'secondary-dark': 'secondary..-dark',
|
|
24
|
+
|
|
25
|
+
'tertiary': 'tertiary',
|
|
26
|
+
'tertiary-dark': 'tertiary..-dark',
|
|
27
|
+
|
|
28
|
+
'success': 'success',
|
|
29
|
+
'success-dark': 'success..-dark',
|
|
30
|
+
|
|
31
|
+
'warning': 'warning',
|
|
32
|
+
'warning-dark': 'warning..-dark',
|
|
33
|
+
|
|
34
|
+
'error': 'error',
|
|
35
|
+
'error-dark': 'error..-dark',
|
|
36
|
+
|
|
37
|
+
'primary-hover': 'primary-hover',
|
|
38
|
+
'primary-hover-dark': 'primary-hover..-dark',
|
|
39
|
+
|
|
40
|
+
// 'secondary-hover': 'secondary-hover',
|
|
41
|
+
// 'secondary-hover-dark': 'secondary-hover..-dark',
|
|
42
|
+
|
|
43
|
+
// 'tertiary-hover': 'tertiary-hover',
|
|
44
|
+
// 'tertiary-hover-dark': 'tertiary-hover..-dark',
|
|
45
|
+
|
|
46
|
+
'success-hover': 'success-hover',
|
|
47
|
+
'success-hover-dark': 'success-hover..-dark',
|
|
48
|
+
|
|
49
|
+
'warning-hover': 'warning-hover',
|
|
50
|
+
'warning-hover-dark': 'warning-hover..-dark',
|
|
51
|
+
|
|
52
|
+
'error-hover': 'error-hover',
|
|
53
|
+
'error-hover-dark': 'error-hover..-dark',
|
|
54
|
+
|
|
55
|
+
'primary-inverse': 'primary-inverse',
|
|
56
|
+
'primary-inverse-dark': 'primary-inverse..-dark',
|
|
57
|
+
|
|
58
|
+
// 'secondary-inverse': 'secondary-inverse',
|
|
59
|
+
// 'secondary-inverse-dark': 'secondary-inverse..-dark',
|
|
60
|
+
|
|
61
|
+
// 'tertiary-inverse': 'tertiary-inverse',
|
|
62
|
+
// 'tertiary-inverse-dark': 'tertiary-inverse..-dark',
|
|
63
|
+
|
|
64
|
+
// 'success-inverse': 'success-inverse',
|
|
65
|
+
// 'success-inverse-dark': 'success-inverse..-dark',
|
|
66
|
+
|
|
67
|
+
// 'warning-inverse': 'warning-inverse',
|
|
68
|
+
// 'warning-inverse-dark': 'warning-inverse..-dark',
|
|
69
|
+
|
|
70
|
+
// 'error-inverse': 'error-inverse',
|
|
71
|
+
// 'error-inverse-dark': 'error-inverse..-dark',
|
|
72
|
+
|
|
73
|
+
'on-primary': 'on-primary',
|
|
74
|
+
'on-primary-dark': 'on-primary..-dark',
|
|
75
|
+
|
|
76
|
+
'on-secondary': 'on-secondary',
|
|
77
|
+
'on-secondary-dark': 'on-secondary..-dark',
|
|
78
|
+
|
|
79
|
+
'on-tertiary': 'on-tertiary',
|
|
80
|
+
'on-tertiary-dark': 'on-tertiary..-dark',
|
|
81
|
+
|
|
82
|
+
'on-success': 'on-success',
|
|
83
|
+
'on-success-dark': 'on-success..-dark',
|
|
84
|
+
|
|
85
|
+
'on-warning': 'on-warning',
|
|
86
|
+
'on-warning-dark': 'on-warning..-dark',
|
|
87
|
+
|
|
88
|
+
'on-error': 'on-error',
|
|
89
|
+
'on-error-dark': 'on-error..-dark',
|
|
90
|
+
|
|
91
|
+
'on-primary-container': 'on-primary-container',
|
|
92
|
+
'on-primary-container-dark': 'on-primary-container..-dark',
|
|
93
|
+
|
|
94
|
+
'on-secondary-container': 'on-secondary-container',
|
|
95
|
+
'on-secondary-container-dark': 'on-secondary-container..-dark',
|
|
96
|
+
|
|
97
|
+
'on-tertiary-container': 'on-tertiary-container',
|
|
98
|
+
'on-tertiary-container-dark': 'on-tertiary-container..-dark',
|
|
99
|
+
|
|
100
|
+
'on-success-container': 'on-success-container',
|
|
101
|
+
'on-success-container-dark': 'on-success-container..-dark',
|
|
102
|
+
|
|
103
|
+
'on-warning-container': 'on-warning-container',
|
|
104
|
+
'on-warning-container-dark': 'on-warning-container..-dark',
|
|
105
|
+
|
|
106
|
+
'on-error-container': 'on-error-container',
|
|
107
|
+
'on-error-container-dark': 'on-error-container..-dark',
|
|
108
|
+
|
|
109
|
+
'on-surface': 'on-surface',
|
|
110
|
+
'on-surface-dark': 'on-surface..-dark',
|
|
111
|
+
|
|
112
|
+
'on-surface-variant': 'on-surface-variant',
|
|
113
|
+
'on-surface-variant-dark': 'on-surface-variant..-dark',
|
|
114
|
+
|
|
115
|
+
'on-surface-inverse': 'inverse-on-surface',
|
|
116
|
+
'on-surface-inverse-dark': 'inverse-on-surface..-dark',
|
|
117
|
+
|
|
118
|
+
'transparent': 'transparent',
|
|
119
|
+
'transparent-dark': 'transparent..-dark',
|
|
120
|
+
|
|
121
|
+
'current': 'current',
|
|
122
|
+
'current-dark': 'current..-dark',
|
|
123
|
+
|
|
124
|
+
'inherit': 'inherit',
|
|
125
|
+
'inherit-dark': 'inherit..-dark',
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
module.exports = {
|
|
129
|
+
values,
|
|
130
|
+
|
|
131
|
+
plugin: plugin(({ matchUtilities, theme }) => {
|
|
132
|
+
matchUtilities({
|
|
133
|
+
'theme-foreground': (value) => {
|
|
134
|
+
const [token, suffix = ''] = value.split('..');
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
color: theme(`textColor.${token}` + suffix, token),
|
|
138
|
+
|
|
139
|
+
'&[disabled]': {
|
|
140
|
+
color: `${theme('textColor.on-disabled' + suffix)} !important`,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
}, { values });
|
|
145
|
+
}),
|
|
146
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
|
|
3
|
+
const values = {
|
|
4
|
+
'primary': 'primary',
|
|
5
|
+
'primary-dark': 'primary..-dark',
|
|
6
|
+
|
|
7
|
+
'secondary': 'secondary',
|
|
8
|
+
'secondary-dark': 'secondary..-dark',
|
|
9
|
+
|
|
10
|
+
'tertiary': 'tertiary',
|
|
11
|
+
'tertiary-dark': 'tertiary..-dark',
|
|
12
|
+
|
|
13
|
+
'success': 'success',
|
|
14
|
+
'success-dark': 'success..-dark',
|
|
15
|
+
|
|
16
|
+
'warning': 'warning',
|
|
17
|
+
'warning-dark': 'warning..-dark',
|
|
18
|
+
|
|
19
|
+
'error': 'error',
|
|
20
|
+
'error-dark': 'error..-dark',
|
|
21
|
+
|
|
22
|
+
'transparent': 'transparent',
|
|
23
|
+
'transparent-dark': 'transparent..-dark',
|
|
24
|
+
|
|
25
|
+
'current': 'current',
|
|
26
|
+
'current-dark': 'current..-dark',
|
|
27
|
+
|
|
28
|
+
'inherit': 'inherit',
|
|
29
|
+
'inherit-dark': 'inherit..-dark',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
values,
|
|
34
|
+
|
|
35
|
+
plugin: plugin(({ matchUtilities, theme }) => {
|
|
36
|
+
matchUtilities({
|
|
37
|
+
'theme-outline-1': (value) => {
|
|
38
|
+
const [token, suffix = ''] = value.split('..');
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
// In Safari outline doesn't follow current border-radius
|
|
42
|
+
// It seems like this is already fixed in Safari Technology Preview (Release 157)
|
|
43
|
+
// Stay tuned for Safari updates
|
|
44
|
+
boxShadow: `0 0 0 1px ${theme(`outlineColor.${token}-opacity-0-16` + suffix, token)}`,
|
|
45
|
+
// outlineOffset: '0',
|
|
46
|
+
// outlineWidth: theme('outlineWidth.2'),
|
|
47
|
+
// outlineStyle: 'solid',
|
|
48
|
+
// outlineColor: theme(`outlineColor.${token}-opacity-0-16` + suffix, token),
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
}, { values });
|
|
52
|
+
|
|
53
|
+
matchUtilities({
|
|
54
|
+
'theme-outline-2': (value) => {
|
|
55
|
+
const [token, suffix = ''] = value.split('..');
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
// In Safari outline doesn't follow current border-radius
|
|
59
|
+
// It seems like this is already fixed in Safari Technology Preview (Release 157)
|
|
60
|
+
// Stay tuned for Safari updates
|
|
61
|
+
boxShadow: `0 0 0 2px ${theme(`outlineColor.${token}-opacity-0-16` + suffix, token)}`,
|
|
62
|
+
// outlineOffset: '0',
|
|
63
|
+
// outlineWidth: theme('outlineWidth.2'),
|
|
64
|
+
// outlineStyle: 'solid',
|
|
65
|
+
// outlineColor: theme(`outlineColor.${token}-opacity-0-16` + suffix, token),
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
}, { values });
|
|
69
|
+
}),
|
|
70
|
+
};
|