Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a sun-like icon for light theme toggle instead of moon #3309

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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