#Subtle variant and color prop of Button, ActionIcon

3 messages · Page 1 of 1 (latest)

topaz briar
#

I noticed that Button and ActionIcon color prop were not working correctly when using a theme color with a shade greater than 6. I then found the defaultVariantColorResolver using a Math.min to ensure 6 is the max

https://github.com/mantinedev/mantine/blob/29f24e31d9c33316395b317cd152648d55c65ef9/packages/%40mantine/core/src/core/MantineProvider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.ts#L143

I can override with a custom variantColorResolver in the theme, but was curious why the subtle variant has that implementation detail for color.

GitHub

A fully featured React components library. Contribute to mantinedev/mantine development by creating an account on GitHub.

#

@steady beacon In case you can share some insights into this.

steady beacon