-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move theme toggler to a partial (#39807)
--------- Co-authored-by: Julien Déramond <[email protected]>
- Loading branch information
1 parent
a0912dc
commit d1636a7
Showing
3 changed files
with
42 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |