@onereach/styles 25.3.7-beta.5824.0 → 25.3.7
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 +4 -3
- package/tailwind/utils.js +20 -0
- package/tailwind.config.json +4 -4
- package/tailwind.config.preset.js +2 -2
- package/tokens-v3.css +6 -0
- package/tokens.css +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/styles",
|
|
3
|
-
"version": "25.3.7
|
|
3
|
+
"version": "25.3.7",
|
|
4
4
|
"description": "Styles for or-ui-next",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"lint": "stylelint '**/*.scss'"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@onereach/font-icons": "^25.3.7
|
|
37
|
+
"@onereach/font-icons": "^25.3.7",
|
|
38
38
|
"tailwindcss": "3.4.16"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -47,5 +47,6 @@
|
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
|
-
}
|
|
50
|
+
},
|
|
51
|
+
"gitHead": "a5a84d0f6f643feea188998bb8a559748c44ca4f"
|
|
51
52
|
}
|
package/tailwind/utils.js
CHANGED
|
@@ -96,6 +96,26 @@ module.exports = {
|
|
|
96
96
|
}), {});
|
|
97
97
|
},
|
|
98
98
|
|
|
99
|
+
parseBorderRadiusTokensNames(designTokens, options = {}) {
|
|
100
|
+
const { prefix = 'or-r', withFallback = false } = options;
|
|
101
|
+
const sanitizeForVar = (name) =>
|
|
102
|
+
String(name).replace(/\+/g, 'plus').replace(/\*/g, 'star');
|
|
103
|
+
|
|
104
|
+
const toVar = (varName, fallback) =>
|
|
105
|
+
withFallback && typeof fallback === 'string'
|
|
106
|
+
? `var(--${varName}, ${fallback})`
|
|
107
|
+
: `var(--${varName})`;
|
|
108
|
+
|
|
109
|
+
return Object.values(designTokens).reduce((preset, token) => {
|
|
110
|
+
const name = token.name;
|
|
111
|
+
const value = token.value;
|
|
112
|
+
|
|
113
|
+
const varName = `${prefix}-${sanitizeForVar(name)}`;
|
|
114
|
+
preset[name] = toVar(varName, value);
|
|
115
|
+
return preset;
|
|
116
|
+
}, {});
|
|
117
|
+
},
|
|
118
|
+
|
|
99
119
|
parseBorderWidthTokens(designTokens) {
|
|
100
120
|
return Object.values(designTokens)
|
|
101
121
|
.map((token) => {
|
package/tailwind.config.json
CHANGED
|
@@ -1782,10 +1782,10 @@
|
|
|
1782
1782
|
"borderRadius": {
|
|
1783
1783
|
"0": "0px",
|
|
1784
1784
|
"none": "0px",
|
|
1785
|
-
"sm": "
|
|
1786
|
-
"md": "
|
|
1787
|
-
"lg": "
|
|
1788
|
-
"xl": "
|
|
1785
|
+
"sm": "var(--or-r-sm)",
|
|
1786
|
+
"md": "var(--or-r-md)",
|
|
1787
|
+
"lg": "var(--or-r-lg)",
|
|
1788
|
+
"xl": "var(--or-r-xl)",
|
|
1789
1789
|
"full": "9999px"
|
|
1790
1790
|
},
|
|
1791
1791
|
"borderWidth": {
|
|
@@ -22,7 +22,6 @@ const { plugin: themeOutline } = require('./tailwind/plugins/theme-outline');
|
|
|
22
22
|
const { plugin: themePreset } = require('./tailwind/plugins/theme-preset');
|
|
23
23
|
const { plugin: typography } = require('./tailwind/plugins/typography');
|
|
24
24
|
const {
|
|
25
|
-
parseBorderRadiusTokens,
|
|
26
25
|
parseBorderWidthTokens,
|
|
27
26
|
parseBoxShadowTokens,
|
|
28
27
|
parseFontFamilyTokens,
|
|
@@ -30,6 +29,7 @@ const {
|
|
|
30
29
|
parseFontWeightTokens,
|
|
31
30
|
parseColorTokensNames,
|
|
32
31
|
parseSpacingTokensNames,
|
|
32
|
+
parseBorderRadiusTokensNames,
|
|
33
33
|
} = require('./tailwind/utils');
|
|
34
34
|
|
|
35
35
|
|
|
@@ -153,7 +153,7 @@ module.exports = {
|
|
|
153
153
|
borderRadius: {
|
|
154
154
|
'none': '0px', // Deprecated, major update required
|
|
155
155
|
'0': '0px',
|
|
156
|
-
...
|
|
156
|
+
...parseBorderRadiusTokensNames(borderRadiusTokens),
|
|
157
157
|
'full': '9999px',
|
|
158
158
|
},
|
|
159
159
|
|
package/tokens-v3.css
CHANGED