Bootstrap's v5 release brings updated styling to various components, including the close button. In previous versions, the close button had an "x" that could be easily styled with text properties, like inheriting color from its parent. However, in v5, the button is now styled using a background SVG image:
.btn-close {
box-sizing: content-box;
width: 1em;
height: 1em;
padding: .25em .25em;
color: #000;
background: transparent url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e) center/1em auto no-repeat;
border: 0;
border-radius: .25rem;
opacity: .5;
}
To adjust the color, you can use the .btn-close-white
variant which applies a CSS filter to invert the color. If you prefer a specific color and are unable to modify SCSS variables directly, there might be other methods available. Some suggestions include styling the background image with CSS filters or exploring alternative approaches to achieve your desired color customization. Feel free to explore different options and see what works best for your setup. Thank you!