Skip to content

Commit

Permalink
Use a sun for light theme toggle instead of moon (#3309)
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Jan 24, 2023
1 parent 758e185 commit 99df16a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
20 changes: 14 additions & 6 deletions lib/resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,26 @@
display: none;
}

#theme-button {
position: absolute;
right: 30px;
height: 24px;
}

#theme-button .material-symbols-outlined {
padding-top: 6px;
color: var(--main-icon-color);
user-select: none;
cursor: pointer;
}

.light-theme #light-theme-button {
display: none;
}

.dark-theme #dark-theme-button {
display: none;
}

/*
Only show images that fit their theme using GitHub's syntax, see:
https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/
Expand Down Expand Up @@ -953,11 +966,6 @@ button {
padding-right: 60px;
}

#theme-button {
position: absolute;
right: 30px;
}

.tt-menu {
position: absolute;
top: 100%;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/generator/templates.aot_renderers_for_html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3126,9 +3126,12 @@ String _deduplicated_lib_templates_html__head_html(
<div class="toggle" id="theme-button">
<label for="theme">
<input type="checkbox" id="theme" value="light-theme">
<span class="material-symbols-outlined">
<span id="dark-theme-button" class="material-symbols-outlined">
brightness_4
</span>
<span id="light-theme-button" class="material-symbols-outlined">
brightness_5
</span>
</label>
</div>
</header>
Expand Down
5 changes: 4 additions & 1 deletion lib/templates/html/_head.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@
<div class="toggle" id="theme-button">
<label for="theme">
<input type="checkbox" id="theme" value="light-theme">
<span class="material-symbols-outlined">
<span id="dark-theme-button" class="material-symbols-outlined">
brightness_4
</span>
<span id="light-theme-button" class="material-symbols-outlined">
brightness_5
</span>
</label>
</div>
</header>
Expand Down

0 comments on commit 99df16a

Please sign in to comment.