DEV Community

Dudu
Dudu

Posted on

How to invert color with bootstrap 5.2

Just use the .btn-close-white class in the component that you want to invert the color.

Bootstrap's docs says that "This class uses the filter property to invert the background-image".

Note that it also adds two more filters, grayscale and brightness, so it may be not suitable in all cases.

SASS
$btn-close-white-filter: invert(1) grayscale(100%) brightness(200%);
Enter fullscreen mode Exit fullscreen mode

Source: https://getbootstrap.com/docs/5.2/components/close-button/#white-variant

Top comments (0)