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

Function colorSwatch

packages/dev/s2-docs/src/color.macro.ts:18–36  ·  view source on GitHub ↗
(
  this: MacroContext | void,
  color: string,
  type = 'backgroundColor',
  size: any = 20
)

Source from the content-addressed store, hash-verified

16}
17
18export function colorSwatch(
19 this: MacroContext | void,
20 color: string,
21 type = 'backgroundColor',
22 size: any = 20
23): string {
24 // @ts-ignore
25 return style.call(this, {
26 '--v': {type, value: color},
27 backgroundColor: '--v',
28 width: size,
29 aspectRatio: 'square',
30 borderRadius: 'sm',
31 borderWidth: 1,
32 borderColor: 'gray-1000/15',
33 borderStyle: 'solid',
34 forcedColorAdjust: 'none'
35 });
36}
37
38/**
39 * Gets the RGB values for a color token.

Callers 6

StyleMacroPropertiesFunction · 0.90
TextColorsDisclosureFunction · 0.90
IconColorsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected