Skip to content

Commit c7aa4e3

Browse files
committed
adjust ratios and one step in the scale formula to better match existing + add half-steps
1 parent 5c9c253 commit c7aa4e3

18 files changed

Lines changed: 167 additions & 77 deletions

File tree

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"medium": [
3+
{
4+
"path": [
5+
"_size",
6+
"mode-font-size"
7+
],
8+
"variable": "--ds-size-mode-font-size",
9+
"value": "1.125"
10+
},
311
{
412
"path": [
513
"font-scale",
@@ -14,18 +22,18 @@
1422
"_ratio"
1523
],
1624
"variable": "--ds-font-scale-ratio",
17-
"value": "1.143"
18-
},
25+
"value": "1.143136"
26+
}
27+
],
28+
"large": [
1929
{
2030
"path": [
2131
"_size",
2232
"mode-font-size"
2333
],
2434
"variable": "--ds-size-mode-font-size",
25-
"value": "1.125"
26-
}
27-
],
28-
"large": [
35+
"value": "1.3125"
36+
},
2937
{
3038
"path": [
3139
"font-scale",
@@ -40,18 +48,18 @@
4048
"_ratio"
4149
],
4250
"variable": "--ds-font-scale-ratio",
43-
"value": "1.146"
44-
},
51+
"value": "1.143136"
52+
}
53+
],
54+
"small": [
4555
{
4656
"path": [
4757
"_size",
4858
"mode-font-size"
4959
],
5060
"variable": "--ds-size-mode-font-size",
51-
"value": "1.3125"
52-
}
53-
],
54-
"small": [
61+
"value": "1"
62+
},
5563
{
5664
"path": [
5765
"font-scale",
@@ -66,15 +74,7 @@
6674
"_ratio"
6775
],
6876
"variable": "--ds-font-scale-ratio",
69-
"value": "1.131"
70-
},
71-
{
72-
"path": [
73-
"_size",
74-
"mode-font-size"
75-
],
76-
"variable": "--ds-size-mode-font-size",
77-
"value": "1"
77+
"value": "1.14234"
7878
}
7979
]
8080
}

apps/www/app/_components/tokens/design-tokens/type-scale.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"7"
5454
],
5555
"variable": "--ds-font-size-7",
56-
"value": "round(calc(1rem * var(--ds-font-scale-base) * pow(var(--ds-font-scale-ratio), 3)), 1px)"
56+
"value": "round(calc(1rem * var(--ds-font-scale-base) * pow(var(--ds-font-scale-ratio), 4)), 1px)"
5757
},
5858
{
5959
"path": [
@@ -79,6 +79,30 @@
7979
"variable": "--ds-font-size-10",
8080
"value": "round(calc(1rem * var(--ds-font-scale-base) * pow(var(--ds-font-scale-ratio), 9)), 1px)"
8181
},
82+
{
83+
"path": [
84+
"font-size",
85+
"6-half"
86+
],
87+
"variable": "--ds-font-size-6-half",
88+
"value": "round(calc(1rem * var(--ds-font-scale-base) * pow(var(--ds-font-scale-ratio), 3)), 1px)"
89+
},
90+
{
91+
"path": [
92+
"font-size",
93+
"8-half"
94+
],
95+
"variable": "--ds-font-size-8-half",
96+
"value": "round(calc(1rem * var(--ds-font-scale-base) * pow(var(--ds-font-scale-ratio), 6)), 1px)"
97+
},
98+
{
99+
"path": [
100+
"font-size",
101+
"9-half"
102+
],
103+
"variable": "--ds-font-size-9-half",
104+
"value": "round(calc(1rem * var(--ds-font-scale-base) * pow(var(--ds-font-scale-ratio), 8)), 1px)"
105+
},
82106
{
83107
"path": [
84108
"typography",

design-tokens/primitives/modes/typography/size/global.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"7": {
4242
"$type": "fontSizes",
43-
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 3), 0)"
43+
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 4), 0)"
4444
},
4545
"8": {
4646
"$type": "fontSizes",
@@ -53,6 +53,18 @@
5353
"10": {
5454
"$type": "fontSizes",
5555
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 9), 0)"
56+
},
57+
"6-half": {
58+
"$type": "fontSizes",
59+
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 3), 0)"
60+
},
61+
"8-half": {
62+
"$type": "fontSizes",
63+
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 6), 0)"
64+
},
65+
"9-half": {
66+
"$type": "fontSizes",
67+
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 8), 0)"
5668
}
5769
},
5870
"letter-spacing": {

design-tokens/primitives/modes/typography/size/large.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"_ratio": {
88
"$type": "number",
9-
"$value": "1.146"
9+
"$value": "1.143136"
1010
}
1111
}
1212
}

design-tokens/primitives/modes/typography/size/medium.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"_ratio": {
88
"$type": "number",
9-
"$value": "1.143"
9+
"$value": "1.143136"
1010
}
1111
}
1212
}

design-tokens/primitives/modes/typography/size/small.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"_ratio": {
88
"$type": "number",
9-
"$value": "1.131"
9+
"$value": "1.14234"
1010
}
1111
}
1212
}

internal/digdir/design-tokens/$themes.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"selectedTokenSets": {
77
"primitives/modes/size/medium": "source",
88
"primitives/modes/size/global": "enabled",
9-
"primitives/modes/typography/size/medium": "source",
10-
"primitives/modes/typography/size/global": "enabled"
9+
"primitives/modes/typography/size/global": "enabled",
10+
"primitives/modes/typography/size/medium": "enabled"
1111
},
1212
"$figmaCollectionId": "VariableCollectionId:36248:20757",
1313
"$figmaModeId": "41630:1",
@@ -20,8 +20,8 @@
2020
"selectedTokenSets": {
2121
"primitives/modes/size/large": "source",
2222
"primitives/modes/size/global": "enabled",
23-
"primitives/modes/typography/size/large": "source",
24-
"primitives/modes/typography/size/global": "enabled"
23+
"primitives/modes/typography/size/global": "enabled",
24+
"primitives/modes/typography/size/large": "enabled"
2525
},
2626
"$figmaCollectionId": "VariableCollectionId:36248:20757",
2727
"$figmaModeId": "41630:2",
@@ -34,8 +34,8 @@
3434
"selectedTokenSets": {
3535
"primitives/modes/size/small": "source",
3636
"primitives/modes/size/global": "enabled",
37-
"primitives/modes/typography/size/small": "source",
38-
"primitives/modes/typography/size/global": "enabled"
37+
"primitives/modes/typography/size/global": "enabled",
38+
"primitives/modes/typography/size/small": "enabled"
3939
},
4040
"$figmaCollectionId": "VariableCollectionId:36248:20757",
4141
"$figmaModeId": "41630:3",

internal/digdir/design-tokens/primitives/modes/typography/size/global.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"7": {
4242
"$type": "fontSizes",
43-
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 3), 0)"
43+
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 4), 0)"
4444
},
4545
"8": {
4646
"$type": "fontSizes",
@@ -53,6 +53,18 @@
5353
"10": {
5454
"$type": "fontSizes",
5555
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 9), 0)"
56+
},
57+
"6-half": {
58+
"$type": "fontSizes",
59+
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 3), 0)"
60+
},
61+
"8-half": {
62+
"$type": "fontSizes",
63+
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 6), 0)"
64+
},
65+
"9-half": {
66+
"$type": "fontSizes",
67+
"$value": "roundTo({font-scale._base} * pow({font-scale._ratio}, 8), 0)"
5668
}
5769
},
5870
"letter-spacing": {

internal/digdir/design-tokens/primitives/modes/typography/size/large.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"_ratio": {
88
"$type": "number",
9-
"$value": "1.146"
9+
"$value": "1.143136"
1010
}
1111
}
1212
}

internal/digdir/design-tokens/primitives/modes/typography/size/medium.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"_ratio": {
88
"$type": "number",
9-
"$value": "1.143"
9+
"$value": "1.143136"
1010
}
1111
}
1212
}

0 commit comments

Comments
 (0)