Dismiss

Provides a unified close/remove button that can be used in other components

Examples

Basic usage

Remove me
<div class="card" data-dismissible>
            <div class="cluster is-between">
                <strong>Remove me</strong>
                <button class="dismiss" type="button" aria-label="Remove">&times;</button>
            </div>
        </div>

Source comments

Dismiss -- unified close/remove button

One implementation across dialog, alert, toast, and any other
dismissible block. Used as:
  <button class="dismiss" type="button" aria-label="Close">×</button>

Parent components (dialog, drawer) override --dismiss-bg-hover when
they sit on --color-surface-float or --color-surface -- on those
surfaces, a solid bg reads better than the shadow-tint default.
That override lives in rescopes.css with the other cross-component
rules, not here.

Reference

Source: src/css/dismiss.css

Applies to

.dismiss

Tokens

TokenDefaultDescription
--dismiss-colorvar(--color-text-muted)Icon color at rest
--dismiss-color-hovervar(--color-text)Icon color on hover
--dismiss-bg-hovervar(--color-shadow)Background color on hover
--dismiss-padding-blockvar(--ui-pad-square-snug)Block-axis inner padding around the icon
--dismiss-padding-inlinevar(--ui-pad-square-snug)Inline-axis inner padding around the icon
--dismiss-size1emExplicit height and width of the button