@payfit/unity-themes 2.38.0 ā 2.38.1
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/dist/css/fonts/heartbreak-eighties/HeartbreakEighties-Oblique.woff +0 -0
- package/dist/css/fonts/heartbreak-eighties/HeartbreakEighties-Oblique.woff2 +0 -0
- package/dist/css/fonts/heartbreak-eighties/HeartbreakEighties-Regular.woff +0 -0
- package/dist/css/fonts/heartbreak-eighties/HeartbreakEighties-Regular.woff2 +0 -0
- package/dist/css/generated/proprietary-fonts.css +11 -0
- package/dist/css/unity.css +8 -7
- package/package.json +1 -1
- package/src/scripts/build.ts +58 -6
- package/tokens/common/font-assets.json +34 -0
- package/tokens/common/font-sizes.json +1 -1
- package/tokens/rebrand/text.json +1 -1
- package/tokens/rebrand/typography.json +12 -12
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "Heartbreak Eighties";
|
|
3
|
+
src: url('../fonts/heartbreak-eighties/HeartbreakEighties-Regular.woff2') format('woff2');
|
|
4
|
+
font-style: normal;
|
|
5
|
+
font-weight: 400;
|
|
6
|
+
},@font-face {
|
|
7
|
+
font-family: "Heartbreak Eighties";
|
|
8
|
+
src: url('../fonts/heartbreak-eighties/HeartbreakEighties-Oblique.woff2') format('woff2');
|
|
9
|
+
font-style: italic;
|
|
10
|
+
font-weight: 400;
|
|
11
|
+
}
|
package/dist/css/unity.css
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
@import "@fontsource/source-serif-4/600.css";
|
|
36
36
|
@import "@fontsource/source-serif-4/700.css";
|
|
37
37
|
@import "@fontsource/roboto-mono";
|
|
38
|
+
@import "./generated/proprietary-fonts.css";
|
|
38
39
|
@import "tailwindcss" prefix(uy);
|
|
39
40
|
|
|
40
41
|
@layer base {
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
--uy-text-600: 28px;
|
|
69
70
|
--uy-text-800: 30px;
|
|
70
71
|
--uy-text-1000: 32px;
|
|
71
|
-
--uy-text-1200:
|
|
72
|
+
--uy-text-1200: 38px;
|
|
72
73
|
--uy-text-1400: 52px;
|
|
73
74
|
--uy-text-1600: 66px;
|
|
74
75
|
--uy-font-weight-regular: 400;
|
|
@@ -617,7 +618,7 @@
|
|
|
617
618
|
--uy-text-600: 28px;
|
|
618
619
|
--uy-text-800: 30px;
|
|
619
620
|
--uy-text-1000: 32px;
|
|
620
|
-
--uy-text-1200:
|
|
621
|
+
--uy-text-1200: 38px;
|
|
621
622
|
--uy-text-1400: 52px;
|
|
622
623
|
--uy-text-1600: 66px;
|
|
623
624
|
--uy-font-weight-regular: 400;
|
|
@@ -805,7 +806,7 @@
|
|
|
805
806
|
--uy-color-utility-shadow-500: oklch(0% 0 none / 0.12157);
|
|
806
807
|
--uy-color-utility-shadow-600: oklch(0% 0 none / 0.12157);
|
|
807
808
|
--uy-shadow-canvas: none;
|
|
808
|
-
--uy-font-serif: "
|
|
809
|
+
--uy-font-serif: "Heartbreak Eighties", serif;
|
|
809
810
|
--uy-font-sans: Inter, sans-serif;
|
|
810
811
|
--uy-font-mono: "Roboto Mono", monospace;
|
|
811
812
|
--uy-grid-layout-gutter--default: calc(var(--uy-spacing) * 2);
|
|
@@ -1114,11 +1115,11 @@
|
|
|
1114
1115
|
--uy-shadow-400: 0px 8px 18px 2px var(--uy-color-utility-shadow-400);
|
|
1115
1116
|
--uy-shadow-500: 0px 8px 24px 4px var(--uy-color-utility-shadow-500);
|
|
1116
1117
|
--uy-shadow-600: 0px 15px 30px 5px var(--uy-color-utility-shadow-600);
|
|
1117
|
-
--uy-typography-default-display-heading: var(--uy-font-weight-
|
|
1118
|
+
--uy-typography-default-display-heading: var(--uy-font-weight-regular) var(--uy-text-1200)/1.1578
|
|
1118
1119
|
var(--uy-font-serif);
|
|
1119
|
-
--uy-typography-sm-display-heading: var(--uy-font-weight-
|
|
1120
|
-
--uy-typography-default-h1: var(--uy-font-weight-
|
|
1121
|
-
--uy-typography-sm-h1: var(--uy-font-weight-
|
|
1120
|
+
--uy-typography-sm-display-heading: var(--uy-font-weight-regular) var(--uy-text-1200)/1.1578 var(--uy-font-serif);
|
|
1121
|
+
--uy-typography-default-h1: var(--uy-font-weight-regular) var(--uy-text-1000)/1.125 var(--uy-font-serif);
|
|
1122
|
+
--uy-typography-sm-h1: var(--uy-font-weight-regular) var(--uy-text-1000)/1.125 var(--uy-font-serif);
|
|
1122
1123
|
--uy-typography-default-h2: var(--uy-font-weight-semibold) var(--uy-text-400)/1.273 var(--uy-font-sans);
|
|
1123
1124
|
--uy-typography-sm-h2: var(--uy-font-weight-semibold) var(--uy-text-500)/1.333 var(--uy-font-sans);
|
|
1124
1125
|
--uy-typography-default-h3: var(--uy-font-weight-semibold) var(--uy-text-200)/1.333 var(--uy-font-sans);
|
package/package.json
CHANGED
package/src/scripts/build.ts
CHANGED
|
@@ -127,6 +127,9 @@ const sharedLogConfig = {
|
|
|
127
127
|
const BUILD_PATH = './dist/css/'
|
|
128
128
|
const OUTPUT_FILE = 'unity.css'
|
|
129
129
|
const ANIMATIONS_PATH = './assets/animations/'
|
|
130
|
+
const DIST_FONTS_PATH = './dist/css/fonts/'
|
|
131
|
+
const DIST_ASSETS_FONTS_PATH = './dist/css/assets/fonts/'
|
|
132
|
+
const GENERATED_FONTS_CSS_PATH = './dist/css/generated/proprietary-fonts.css'
|
|
130
133
|
const PREFIX = 'uy'
|
|
131
134
|
|
|
132
135
|
// ---------------------------------------------------------------------------
|
|
@@ -160,7 +163,7 @@ async function build() {
|
|
|
160
163
|
const startTime = performance.now()
|
|
161
164
|
console.log(color.bold('\nš Unity Themes ā Build\n'))
|
|
162
165
|
|
|
163
|
-
// 1.
|
|
166
|
+
// 1. Initialize SD instances
|
|
164
167
|
logStep(1, TOTAL_STEPS, 'Initializing Style Dictionary instances')
|
|
165
168
|
logDetail(
|
|
166
169
|
`Legacy ā tokens/common + tokens/legacy ā ${color.yellow(':root')}`,
|
|
@@ -248,16 +251,64 @@ async function build() {
|
|
|
248
251
|
log: sharedLogConfig,
|
|
249
252
|
})
|
|
250
253
|
|
|
251
|
-
//
|
|
252
|
-
|
|
254
|
+
// Fonts SD ā built-in css/fonts format + copy_assets action
|
|
255
|
+
logDetail(
|
|
256
|
+
`Fonts ā tokens/common/font-assets.json ā ${color.yellow(
|
|
257
|
+
'generated/proprietary-fonts.css',
|
|
258
|
+
)}`,
|
|
259
|
+
)
|
|
260
|
+
const fontsSD = new StyleDictionary({
|
|
261
|
+
source: ['./tokens/common/font-assets.json'],
|
|
262
|
+
platforms: {
|
|
263
|
+
css: {
|
|
264
|
+
buildPath: BUILD_PATH,
|
|
265
|
+
actions: ['copy_assets'],
|
|
266
|
+
files: [
|
|
267
|
+
{
|
|
268
|
+
destination: 'generated/proprietary-fonts.css',
|
|
269
|
+
format: 'css/fonts.css',
|
|
270
|
+
options: {
|
|
271
|
+
showFileHeader: false,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
log: sharedLogConfig,
|
|
278
|
+
})
|
|
279
|
+
|
|
280
|
+
// 2. Build fonts css + copy assets, then format theme outputs in-memory
|
|
281
|
+
logStep(2, TOTAL_STEPS, 'Building font assets and formatting tokens')
|
|
253
282
|
const formatStart = performance.now()
|
|
254
283
|
|
|
255
284
|
const [legacyOutputs, rebrandOutputs, themeOutputs] = await Promise.all([
|
|
256
285
|
legacySD.formatPlatform('css'),
|
|
257
286
|
rebrandSD.formatPlatform('css'),
|
|
258
287
|
themeSD.formatPlatform('css'),
|
|
288
|
+
fontsSD.buildPlatform('css'),
|
|
259
289
|
])
|
|
260
290
|
|
|
291
|
+
// normalize copied assets path from dist/css/assets/fonts to dist/css/fonts
|
|
292
|
+
if (!fs.existsSync(DIST_ASSETS_FONTS_PATH)) {
|
|
293
|
+
throw new Error(`Missing copied font assets at ${DIST_ASSETS_FONTS_PATH}`)
|
|
294
|
+
}
|
|
295
|
+
fs.rmSync(DIST_FONTS_PATH, { recursive: true, force: true })
|
|
296
|
+
fs.cpSync(DIST_ASSETS_FONTS_PATH, DIST_FONTS_PATH, {
|
|
297
|
+
recursive: true,
|
|
298
|
+
filter: source => !source.includes(`${path.sep}LICENSES${path.sep}`),
|
|
299
|
+
})
|
|
300
|
+
fs.rmSync('./dist/css/assets/', { recursive: true, force: true })
|
|
301
|
+
|
|
302
|
+
if (!fs.existsSync(GENERATED_FONTS_CSS_PATH)) {
|
|
303
|
+
throw new Error(`Missing generated font CSS at ${GENERATED_FONTS_CSS_PATH}`)
|
|
304
|
+
}
|
|
305
|
+
const generatedFontsCss = fs.readFileSync(GENERATED_FONTS_CSS_PATH, 'utf8')
|
|
306
|
+
fs.writeFileSync(
|
|
307
|
+
GENERATED_FONTS_CSS_PATH,
|
|
308
|
+
generatedFontsCss.replaceAll('},`@font-face`', '}\n\n@font-face'),
|
|
309
|
+
'utf8',
|
|
310
|
+
)
|
|
311
|
+
|
|
261
312
|
const legacyCss =
|
|
262
313
|
typeof legacyOutputs[0]?.output === 'string' ? legacyOutputs[0].output : ''
|
|
263
314
|
const rebrandCss =
|
|
@@ -279,7 +330,7 @@ async function build() {
|
|
|
279
330
|
)
|
|
280
331
|
logDetail(color.dim(`Formatted in ${formatDuration}ms`))
|
|
281
332
|
|
|
282
|
-
//
|
|
333
|
+
// 3. Generate header + custom variants
|
|
283
334
|
logStep(3, TOTAL_STEPS, 'Generating file header and font imports')
|
|
284
335
|
const headerLines = unityFileHeader()
|
|
285
336
|
const header = [
|
|
@@ -295,6 +346,7 @@ async function build() {
|
|
|
295
346
|
'@import "@fontsource/source-serif-4/600.css";',
|
|
296
347
|
'@import "@fontsource/source-serif-4/700.css";',
|
|
297
348
|
'@import "@fontsource/roboto-mono";',
|
|
349
|
+
'@import "./generated/proprietary-fonts.css";',
|
|
298
350
|
`@import "tailwindcss" prefix(${PREFIX});`,
|
|
299
351
|
].join('\n')
|
|
300
352
|
|
|
@@ -306,7 +358,7 @@ async function build() {
|
|
|
306
358
|
logDetail('theme-legacy ā [data-uy-theme="legacy"]')
|
|
307
359
|
logDetail('theme-rebrand ā [data-uy-theme="rebrand"]')
|
|
308
360
|
|
|
309
|
-
//
|
|
361
|
+
// 5. Compose and write
|
|
310
362
|
logStep(5, TOTAL_STEPS, 'Composing multi-theme CSS')
|
|
311
363
|
const outputPath = path.join(BUILD_PATH, OUTPUT_FILE)
|
|
312
364
|
logDetail(`Output: ${color.yellow(outputPath)}`)
|
|
@@ -320,7 +372,7 @@ async function build() {
|
|
|
320
372
|
outputPath,
|
|
321
373
|
})
|
|
322
374
|
|
|
323
|
-
//
|
|
375
|
+
// 6. Append animation keyframes + reset CSS
|
|
324
376
|
logStep(6, TOTAL_STEPS, 'Appending animation keyframes')
|
|
325
377
|
logDetail(`Source: ${color.yellow(ANIMATIONS_PATH)}`)
|
|
326
378
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"asset": {
|
|
3
|
+
"font": {
|
|
4
|
+
"heartbreak-eighties-regular": {
|
|
5
|
+
"name": {
|
|
6
|
+
"value": "Heartbreak Eighties"
|
|
7
|
+
},
|
|
8
|
+
"woff2": {
|
|
9
|
+
"value": "fonts/heartbreak-eighties/HeartbreakEighties-Regular.woff2"
|
|
10
|
+
},
|
|
11
|
+
"style": {
|
|
12
|
+
"value": "normal"
|
|
13
|
+
},
|
|
14
|
+
"weight": {
|
|
15
|
+
"value": "400"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"heartbreak-eighties-oblique": {
|
|
19
|
+
"name": {
|
|
20
|
+
"value": "Heartbreak Eighties"
|
|
21
|
+
},
|
|
22
|
+
"woff2": {
|
|
23
|
+
"value": "fonts/heartbreak-eighties/HeartbreakEighties-Oblique.woff2"
|
|
24
|
+
},
|
|
25
|
+
"style": {
|
|
26
|
+
"value": "italic"
|
|
27
|
+
},
|
|
28
|
+
"weight": {
|
|
29
|
+
"value": "400"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
package/tokens/rebrand/text.json
CHANGED
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
"default": {
|
|
6
6
|
"$value": {
|
|
7
7
|
"fontFamily": "{font.serif}",
|
|
8
|
-
"fontSize": "{text.
|
|
9
|
-
"fontWeight": "{font-weight.
|
|
10
|
-
"lineHeight": 1.
|
|
8
|
+
"fontSize": "{text.1200}",
|
|
9
|
+
"fontWeight": "{font-weight.regular}",
|
|
10
|
+
"lineHeight": 1.1578
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"sm": {
|
|
14
14
|
"$value": {
|
|
15
15
|
"fontFamily": "{font.serif}",
|
|
16
|
-
"fontSize": "{text.
|
|
17
|
-
"fontWeight": "{font-weight.
|
|
18
|
-
"lineHeight": 1.
|
|
16
|
+
"fontSize": "{text.1200}",
|
|
17
|
+
"fontWeight": "{font-weight.regular}",
|
|
18
|
+
"lineHeight": 1.1578
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
},
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
"default": {
|
|
24
24
|
"$value": {
|
|
25
25
|
"fontFamily": "{font.serif}",
|
|
26
|
-
"fontSize": "{text.
|
|
27
|
-
"fontWeight": "{font-weight.
|
|
28
|
-
"lineHeight": 1.
|
|
26
|
+
"fontSize": "{text.1000}",
|
|
27
|
+
"fontWeight": "{font-weight.regular}",
|
|
28
|
+
"lineHeight": 1.125
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"sm": {
|
|
32
32
|
"$value": {
|
|
33
33
|
"fontFamily": "{font.serif}",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
34
|
+
"fontSize": "{text.1000}",
|
|
35
|
+
"fontWeight": "{font-weight.regular}",
|
|
36
|
+
"lineHeight": 1.125
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
},
|