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

Function iconStyle

packages/@react-spectrum/s2/style/index.ts:170–187  ·  view source on GitHub ↗
(
  this: MacroContext | void,
  options: IconStyle
)

Source from the content-addressed store, hash-verified

168 * @returns A `StyleString` that can be applied to an icon element.
169 */
170export function iconStyle(
171 this: MacroContext | void,
172 options: IconStyle
173): StyleString<Exclude<keyof IconStyle, 'color' | 'size'>> {
174 let {size = 'M', color, ...styles} = options;
175
176 if (color) {
177 styles['--iconPrimary'] = {
178 type: 'fill',
179 value: color
180 };
181 }
182
183 styles['size'] = iconSizes[size];
184
185 // @ts-ignore
186 return style.call(this, styles);
187}

Callers 15

Header.tsxFile · 0.90
renderCheckMarkFunction · 0.90
ColorItemFunction · 0.90
AnchorLinkFunction · 0.90
SubpageHeaderFunction · 0.90
InstallCommandFunction · 0.90
IconItemFunction · 0.90
SkeletonIconItemFunction · 0.90
CommandFunction · 0.90
ShadcnCommandFunction · 0.90
InfoMessageFunction · 0.90
DisclosureRow.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected