Skip to content

Commit 2951868

Browse files
committed
fix pu-icon mixin lost font-size; align token naming
1 parent e865587 commit 2951868

5 files changed

Lines changed: 28 additions & 6 deletions

File tree

.changeset/all-bees-look.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@partner-up-dev/design-uniapp": patch
3+
---
4+
5+
fix pu-icon mixin lost font-size; align token naming

packages/uniapp/src/styles/_mixins.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@
1010

1111
/* Typography Mixin - uses CSS variables (composite token) */
1212
@mixin pu-font($key, $mono: false) {
13-
font-size: var(--sys-font-#{$key}-size);
14-
font-weight: var(--sys-font-#{$key}-weight);
15-
line-height: var(--sys-font-#{$key}-line-height);
13+
font-size: var(--sys-typo-#{$key}-size);
14+
font-weight: var(--sys-typo-#{$key}-weight);
15+
line-height: var(--sys-typo-#{$key}-line-height);
1616
@if $mono == true {
1717
font-family: var(--ref-font-family-mono);
1818
}
1919
}
2020

21+
@mixin pu-font-size($key) {
22+
font-size: var(--sys-typo-#{$key}-size);
23+
}
24+
2125
/* Elevation (Shadow) Mixin - uses CSS variables */
2226
@mixin pu-elevation($level) {
2327
box-shadow: var(--sys-shadow-#{$level});

packages/uniapp/src/styles/_ref.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ $typography: (
209209

210210
$font: (
211211
family: (
212-
mono: monospace,
212+
mono: "ui-monospace, monospace",
213213
),
214214
);
215215

@@ -218,3 +218,15 @@ $opacity: (
218218
disabled: 0.6,
219219
invalid: 0.6,
220220
);
221+
222+
$all: (
223+
color: $color,
224+
spacing: $spacing,
225+
radius: $radius,
226+
size: $size,
227+
icon: $icon,
228+
shadow: $shadow,
229+
typo: $typography,
230+
font: $font,
231+
opacity: $opacity
232+
);

packages/uniapp/src/styles/_sys.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ $base: (
123123
size: ref.$size,
124124
icon: ref.$icon,
125125
shadow: ref.$shadow,
126-
font: ref.$typography,
126+
typo: ref.$typography,
127+
font: ref.$font,
127128
opacity: ref.$opacity,
128129
);

packages/uniapp/src/styles/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/* Emit all reference tokens as CSS variables */
1818
:root, page {
1919
/* Emit ref tokens */
20-
@include fn.emit-css-variables((color: ref.$color, spacing: ref.$spacing, radius: ref.$radius, size: ref.$size, icon: ref.$icon, shadow: ref.$shadow, typography: ref.$typography, font: ref.$font, opacity: ref.$opacity), 'ref');
20+
@include fn.emit-css-variables(ref.$all, 'ref');
2121

2222
/* Emit system tokens (light mode default) */
2323
@include fn.emit-css-variables(sys.$light, 'sys');

0 commit comments

Comments
 (0)