Close button
By adding .close-button
to <button>
it will be a button with close icon.
Accessibility matters!
You do not need to add anything inside the close button element but it is necessary to set an aria-label
HTML attribute for accessibility purposes. Read more about aria-label usage.
<button class="close-button" aria-label="Close"></button>
<button class="button close-button" aria-label="Close"/></button>
Sizes
To change the button size use size setter classes.
These classes just set a font-size
property so it is possible to change it yourself by writing custom CSS.
<button class="close-button" aria-label="Close"></button>
<button class="close-button size-lg" aria-label="Close"></button>
<button class="close-button size-2x" aria-label="Close"></button>
Colors
There are helper classes for styling elements like button, first read about color setter classes for having button with diffrent background and text color.
<button class="close-button style-success" aria-label="Close"></button>
<button class="close-button style-warning" aria-label="Close"></button>
<button class="close-button style-purple" aria-label="Close"></button>
<button class="close-button style-red" aria-label="Close"></button>
<button class="close-button color-success" aria-label="Close"></button>
<button class="close-button color-warning" aria-label="Close"></button>
<button class="close-button color-purple" aria-label="Close"></button>
<button class="close-button color-red" aria-label="Close"></button>
Change close icon
It is possible to change the close button icon with both _config.scss
and CSS variables.
Inside _config.scss
find $CLOSE_ICON
and set svg of customized icon with this format:
$CLOSE_ICON: url("data:image/svg+xml; utf8, YOUR SVG CODE HERE");
or
change its CSS variable:
--flatify__close-icon: url("data:image/svg+xml; utf8, YOUR SVG CODE HERE");