- From: Andrei Herasimchuk via GitHub <sysbot+gh@w3.org>
- Date: Wed, 23 Apr 2025 12:17:05 +0000
- To: public-design-tokens-log@w3.org
I would imagine the solution to this issue would be:
- Create a reserved list of unit names
- Reserved list to start: px, pt, rem, em, dp, sp, vh, percent
- Expand that list as unit names are reviewed and approved
- Allow any unit via a custom unit type
```
padding: {
tight: { <--- token name
name: "Tight", <--- display name
type: exact, <--- declares token type (exact, custom, or computed)
value: {
unit: pixel, <--- only reserved unit names allowed
number: 8, <--- float
},
},
compact: {
name: "Compact",
type: exact,
value: {
unit: rem,
number: 1,
},
},
cozy: {
name: "Cozy",
type: exact,
value: {
unit: percent,
number: 25,
},
},
comfortable: {
name: "Comfortable",
type: computed,
value: {
function: modulate
ratio: majorThird,
step: 3.11,
base: 14,
unit: rem
},
},
open: {
name: "Open",
type: custom,
value: {
unit: figma-megapixels,
number: 2000,
},
},
},
```
--
GitHub Notification of comment by AndreiSeldon
Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/245#issuecomment-2824094833 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 23 April 2025 12:17:06 UTC