diff options
| author | XhmikosR <[email protected]> | 2021-09-07 21:49:51 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-09-07 21:49:51 +0300 |
| commit | 65413de3131294cbf7bc8bff94914cc8062149c6 (patch) | |
| tree | d606f927ef9d5e505245b0fce29366979d219f83 /site/layouts/shortcodes/js-dismiss.html | |
| parent | 72e79d0e3997c3a850263880240f26684b9784f7 (diff) | |
| parent | 0d81d3cbc14dfcdca8a868e3f25189a4f1ab273c (diff) | |
| download | bootstrap-docs-offcanvas-navbar.tar.xz bootstrap-docs-offcanvas-navbar.zip | |
Merge branch 'main' into docs-offcanvas-navbardocs-offcanvas-navbar
Diffstat (limited to 'site/layouts/shortcodes/js-dismiss.html')
| -rw-r--r-- | site/layouts/shortcodes/js-dismiss.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/site/layouts/shortcodes/js-dismiss.html b/site/layouts/shortcodes/js-dismiss.html new file mode 100644 index 000000000..45d72d0eb --- /dev/null +++ b/site/layouts/shortcodes/js-dismiss.html @@ -0,0 +1,15 @@ +{{- /* Usage: js-dismiss "ComponentName" */ -}} + +{{- $name := .Get 0 -}} + +Dismissal can be achieved with the `data` attribute on a button **within the {{ $name }}** as demonstrated below: + +```html +<button type="button" class="btn-close" data-bs-dismiss="{{ $name }}" aria-label="Close"></button> +``` + +or on a button **outside the {{ $name }}** using the `data-bs-target` as demonstrated below: + +```html +<button type="button" class="btn-close" data-bs-dismiss="{{ $name }}" data-bs-target="#my-{{ $name }}" aria-label="Close"></button> +``` |
