MCPcopy Create free account
hub / github.com/adobe/react-spectrum / weirdColorToken

Function weirdColorToken

packages/@react-spectrum/s2/style/tokens.ts:68–75  ·  view source on GitHub ↗
(name: TokenName)

Source from the content-addressed store, hash-verified

66}
67
68export 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
77type ReplaceColor<S extends string> = S extends `${infer S}-color-${infer N}` ? `${S}-${N}` : S;
78

Callers 1

spectrum-theme.tsFile · 0.90

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected