@aleph-alpha/config-css 0.22.0 → 1.0.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/CHANGELOG.md +11 -0
- package/dist/index.js +7 -2
- package/package.json +2 -2
- package/sd.config.js +9 -3
- package/src/index.ts +4 -1
- package/src/presetWebFontsAlephAlpha.ts +7 -2
- package/src/utils/convert-fonts.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@
|
|
|
5
5
|
- Updated config-prettier to 0.3.117
|
|
6
6
|
- Updated config-eslint to 0.3.183
|
|
7
7
|
|
|
8
|
+
## [1.0.0](https://github.com/Aleph-Alpha/frontend-hub/compare/config-css-preset-0.22.0...config-css-preset-1.0.0) (2026-05-05)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### ⚠ BREAKING CHANGES
|
|
12
|
+
|
|
13
|
+
* **config-prettier:** Files formatted with this config will reflow. Consumers need to re-run prettier --write after bumping.
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **config-prettier:** change printWidth from 100 to 80 ([#257](https://github.com/Aleph-Alpha/frontend-hub/issues/257)) ([f9777d1](https://github.com/Aleph-Alpha/frontend-hub/commit/f9777d168ed7dc40b9de09cea9456ca809d1d462))
|
|
18
|
+
|
|
8
19
|
## [0.22.0](https://github.com/Aleph-Alpha/frontend-hub/compare/config-css-preset-0.21.2...config-css-preset-0.22.0) (2026-04-13)
|
|
9
20
|
|
|
10
21
|
|
package/dist/index.js
CHANGED
|
@@ -2417,7 +2417,9 @@ const Gr = (r = {}) => {
|
|
|
2417
2417
|
"data:@file/binary;base64,",
|
|
2418
2418
|
"data:%40file/octet-stream;base64,",
|
|
2419
2419
|
"data:%40file/binary;base64,"
|
|
2420
|
-
].find(
|
|
2420
|
+
].find(
|
|
2421
|
+
(o) => e.startsWith(o)
|
|
2422
|
+
);
|
|
2421
2423
|
return n ? `data:${t};base64,${e.slice(n.length)}` : e;
|
|
2422
2424
|
}, Ai = () => ({
|
|
2423
2425
|
name: "@aleph-alpha/ds-fonts",
|
|
@@ -2622,7 +2624,10 @@ const Gr = (r = {}) => {
|
|
|
2622
2624
|
}
|
|
2623
2625
|
}
|
|
2624
2626
|
],
|
|
2625
|
-
rules: [
|
|
2627
|
+
rules: [
|
|
2628
|
+
...Object.entries(Jr),
|
|
2629
|
+
["h-screen", { height: "100vh" }]
|
|
2630
|
+
],
|
|
2626
2631
|
theme: {
|
|
2627
2632
|
colors: O,
|
|
2628
2633
|
spacing: b,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aleph-alpha/config-css",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"prettier": "@aleph-alpha/prettier-config-frontend",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"style-dictionary": "^4.0.1",
|
|
26
26
|
"vite-plugin-dts": "^4.0.0",
|
|
27
27
|
"@aleph-alpha/eslint-config-frontend": "0.5.0",
|
|
28
|
-
"@aleph-alpha/prettier-config-frontend": "0.
|
|
28
|
+
"@aleph-alpha/prettier-config-frontend": "2.0.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"transform:global": "npx token-transformer ./tokens.json ./transformed-tokens/global.json global,\"Spark Border Radius/Mode 1\",\"Spark Spacings/Mode 1\",\"Spark Text/Mode 1\" \"Spark Colors/Light mode/primitives\" --throwErrorWhenNotResolved",
|
package/sd.config.js
CHANGED
|
@@ -38,7 +38,10 @@ StyleDictionary.registerTransform({
|
|
|
38
38
|
return token.type === 'typography';
|
|
39
39
|
},
|
|
40
40
|
transform: function (token) {
|
|
41
|
-
return token.name
|
|
41
|
+
return token.name
|
|
42
|
+
.split('-')
|
|
43
|
+
.splice(1, token.name.split('-').length)
|
|
44
|
+
.join('-');
|
|
42
45
|
},
|
|
43
46
|
});
|
|
44
47
|
|
|
@@ -85,7 +88,9 @@ StyleDictionary.registerTransform({
|
|
|
85
88
|
|
|
86
89
|
const css = {};
|
|
87
90
|
keys.forEach((key) => {
|
|
88
|
-
const newKey = key
|
|
91
|
+
const newKey = key
|
|
92
|
+
.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2')
|
|
93
|
+
.toLowerCase();
|
|
89
94
|
|
|
90
95
|
if (allowedKeys.includes(newKey)) {
|
|
91
96
|
css[newKey] = value[key];
|
|
@@ -110,7 +115,8 @@ StyleDictionary.registerTransform({
|
|
|
110
115
|
if (!value) return;
|
|
111
116
|
|
|
112
117
|
if (value['font-family']) {
|
|
113
|
-
value['font-family'] =
|
|
118
|
+
value['font-family'] =
|
|
119
|
+
`var(--custom-font-family, ${value['font-family']})`;
|
|
114
120
|
}
|
|
115
121
|
|
|
116
122
|
return value;
|
package/src/index.ts
CHANGED
|
@@ -106,7 +106,10 @@ const tokenPreset: Preset<Theme> = definePreset<Theme>(() => {
|
|
|
106
106
|
},
|
|
107
107
|
},
|
|
108
108
|
],
|
|
109
|
-
rules: [
|
|
109
|
+
rules: [
|
|
110
|
+
...Object.entries(typographySet),
|
|
111
|
+
['h-screen', { height: '100vh' }],
|
|
112
|
+
],
|
|
110
113
|
theme: {
|
|
111
114
|
colors: lightModeSet,
|
|
112
115
|
spacing: spacingsSet,
|
|
@@ -12,7 +12,10 @@ import { inter500 } from './assets/fonts/inter500.woff2';
|
|
|
12
12
|
import { inter600 } from './assets/fonts/inter600.woff2';
|
|
13
13
|
import { inter700 } from './assets/fonts/inter700.woff2';
|
|
14
14
|
|
|
15
|
-
const normalizeEmbeddedFontDataUri = (
|
|
15
|
+
const normalizeEmbeddedFontDataUri = (
|
|
16
|
+
fontDataUri: string,
|
|
17
|
+
mimeType = 'font/woff2',
|
|
18
|
+
) => {
|
|
16
19
|
const normalizedUri = fontDataUri.trim();
|
|
17
20
|
const legacyPrefixes = [
|
|
18
21
|
'data:@file/octet-stream;base64,',
|
|
@@ -21,7 +24,9 @@ const normalizeEmbeddedFontDataUri = (fontDataUri: string, mimeType = 'font/woff
|
|
|
21
24
|
'data:%40file/binary;base64,',
|
|
22
25
|
];
|
|
23
26
|
|
|
24
|
-
const matchedPrefix = legacyPrefixes.find((prefix) =>
|
|
27
|
+
const matchedPrefix = legacyPrefixes.find((prefix) =>
|
|
28
|
+
normalizedUri.startsWith(prefix),
|
|
29
|
+
);
|
|
25
30
|
if (matchedPrefix) {
|
|
26
31
|
return `data:${mimeType};base64,${normalizedUri.slice(matchedPrefix.length)}`;
|
|
27
32
|
}
|
|
@@ -32,7 +32,9 @@ const args = process.argv.slice(2);
|
|
|
32
32
|
|
|
33
33
|
if (args.length < 2) {
|
|
34
34
|
console.log('Usage: node convert-fonts.js <input.woff2> <output.ts>');
|
|
35
|
-
console.log(
|
|
35
|
+
console.log(
|
|
36
|
+
'Example: node convert-fonts.js montserrat600.woff2 montserrat600.woff2.ts',
|
|
37
|
+
);
|
|
36
38
|
process.exit(1);
|
|
37
39
|
}
|
|
38
40
|
|