diff options
| author | Bobby <[email protected]> | 2024-08-16 20:47:33 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-08-16 20:47:33 -0400 |
| commit | 6b28433d9cfde435be8ec2bd6cf91e6324d08865 (patch) | |
| tree | 8343c27b8b95ff5639233e81cf157f92e5688466 /site/layouts/partials/theme-toggler.html | |
| parent | d53094ec16ba385faae2973ddee648698b32ab24 (diff) | |
| parent | 048f56f51460df75e92a2f7b472e1c56baeb68f7 (diff) | |
| download | bootstrap-main.tar.xz bootstrap-main.zip | |
Diffstat (limited to 'site/layouts/partials/theme-toggler.html')
| -rw-r--r-- | site/layouts/partials/theme-toggler.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/site/layouts/partials/theme-toggler.html b/site/layouts/partials/theme-toggler.html new file mode 100644 index 000000000..05de756fd --- /dev/null +++ b/site/layouts/partials/theme-toggler.html @@ -0,0 +1,34 @@ +{{- $isExamples := eq .Layout "examples" -}} +<button class="btn {{ if $isExamples }}btn-bd-primary{{ else }}btn-link nav-link px-0 px-lg-2{{ end }} py-2 dropdown-toggle d-flex align-items-center" + id="bd-theme" + type="button" + aria-expanded="false" + data-bs-toggle="dropdown" + {{ if not $isExamples }}data-bs-display="static"{{ end }} + aria-label="Toggle theme (auto)"> + <svg class="bi my-1 theme-icon-active"><use href="#circle-half"></use></svg> + <span class="{{ if $isExamples }}visually-hidden{{ else }}d-lg-none ms-2{{ end }}" id="bd-theme-text">Toggle theme</span> +</button> +<ul class="dropdown-menu dropdown-menu-end{{ if $isExamples }} shadow{{ end }}" aria-labelledby="bd-theme-text"> + <li> + <button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="light" aria-pressed="false"> + <svg class="bi me-2 opacity-50"><use href="#sun-fill"></use></svg> + Light + <svg class="bi ms-auto d-none"><use href="#check2"></use></svg> + </button> + </li> + <li> + <button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="dark" aria-pressed="false"> + <svg class="bi me-2 opacity-50"><use href="#moon-stars-fill"></use></svg> + Dark + <svg class="bi ms-auto d-none"><use href="#check2"></use></svg> + </button> + </li> + <li> + <button type="button" class="dropdown-item d-flex align-items-center active" data-bs-theme-value="auto" aria-pressed="true"> + <svg class="bi me-2 opacity-50"><use href="#circle-half"></use></svg> + Auto + <svg class="bi ms-auto d-none"><use href="#check2"></use></svg> + </button> + </li> +</ul> |
