Skip to content

Commit cc18e04

Browse files
authored
Merge pull request #84 from nditcommunity/material-symbols-darkmode-toggle
PoC light/dark mode toggle using Google Fonts material-symbols
2 parents e079450 + 40b6c2e commit cc18e04

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

src/_includes/head.liquid

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
rel='apple-touch-icon'
7373
href='/icon.png'
7474
>
75+
<link
76+
href='https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined'
77+
rel='stylesheet'
78+
>
7579

7680
<link
7781
rel='manifest'

src/_includes/header.liquid

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
</li>
2727
<li>
2828
<p class='nav-item theme-icon'>
29-
<span class='sun-icon hidden'>☼</span>
30-
<span class='moon-icon'>☾</span>
29+
<span class='sun-icon hidden material-symbols-outlined'>light_mode</span>
30+
<span class='moon-icon material-symbols-outlined'>dark_mode</span>
3131
</p>
3232
</li>
3333
</ul>

src/styles/style.css

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -441,19 +441,11 @@ body.day-mode .nav-item {
441441
color: var(--black);
442442
}
443443

444-
.theme-icon {
445-
font-size: 1.2rem;
446-
cursor: pointer;
447-
width: 0.2rem;
448-
margin-right: 16px;
449-
}
450-
451-
.sun-icon {
452-
color: var(--white);
453-
}
454-
444+
.sun-icon,
455445
.moon-icon {
456-
color: var(--black);
446+
cursor: pointer;
447+
font-size: 100% !important;
448+
padding-top: 2.5px;
457449
}
458450

459451
/* ---------- FOOTER ---------- */

0 commit comments

Comments
 (0)