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

Function addScale

packages/dev/mcp/s2/scripts/build-data.mjs:107–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105 keys.add('white');
106
107 const addScale = scale => {
108 const re = new RegExp(`^${scale}-\\d+$`);
109 for (const tokenName of Object.keys(tokens)) {
110 if (re.test(tokenName)) {
111 // Match @react-spectrum/s2/style/tokens.ts behavior: strip "-color" in the middle.
112 keys.add(tokenName.replace('-color', ''));
113 }
114 }
115 };
116
117 // Global color scales
118 for (const scale of [

Callers 1

Calls 1

addMethod · 0.65

Tested by

no test coverage detected