( this: MacroContext | void, options: IconStyle )
| 168 | * @returns A `StyleString` that can be applied to an icon element. |
| 169 | */ |
| 170 | export 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 | } |
no outgoing calls
no test coverage detected