(name: TokenName)
| 66 | } |
| 67 | |
| 68 | export function weirdColorToken(name: TokenName): ColorRef { |
| 69 | let token = tokens[name] as (typeof tokens)['accent-background-color-default']; |
| 70 | return { |
| 71 | type: 'ref', |
| 72 | light: token.sets.light.ref.slice(1, -1).replace('-color', ''), |
| 73 | dark: token.sets.dark.ref.slice(1, -1).replace('-color', '') |
| 74 | }; |
| 75 | } |
| 76 | |
| 77 | type ReplaceColor<S extends string> = S extends `${infer S}-color-${infer N}` ? `${S}-${N}` : S; |
| 78 |