0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-02 14:24:19 +01:00
Bootstrap/site/content/docs/5.0/components/close-button.md
Mark Otto 4c7a3e8adf
Add Sass docs (variables, mixins, and loops) to most pages (#32747)
* WIP: Mention variables, mixins, and loops in docs

* Add Sass sections to component pages

* add sass docs for forms and content

* Update buttons.md

* Remove empty mixins sections

* Massive update to utilities and some consistency changes

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2021-02-10 19:29:59 -08:00

1.3 KiB

layout title description group toc
docs Close button A generic close button for dismissing content like modals and alerts. components true

Example

Provide an option to dismiss or close a component with .btn-close. Default styling is limited, but highly customizable. Modify the Sass variables to replace the default background-image. Be sure to include text for screen readers, as we've done with aria-label.

{{< example >}} {{< /example >}}

Disabled state

Disabled close buttons change their opacity. We've also applied pointer-events: none and user-select: none to preventing hover and active states from triggering.

{{< example >}} {{< /example >}}

White variant

Change the default .btn-close to be white with the .btn-close-white class. This class uses the filter property to invert the background-image.

{{< example class="bg-dark" >}} {{< /example >}}

Sass

Variables

{{< scss-docs name="close-variables" file="scss/_variables.scss" >}}