Skip to content

Commit aeb980a

Browse files
committed
Use a pill-like button to toggle color mode
1 parent a908da6 commit aeb980a

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

layouts/Application/components/Footer/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,17 @@ export function Footer() {
7878
</ul>
7979

8080
<button className="AppFooter__DarkModeToggle" onClick={() => toggleDarkMode()}>
81-
{isDarkModeEnabled ? <RxSun /> : <RxMoon />}
81+
{isDarkModeEnabled && (
82+
<>
83+
<RxSun /> Use light mode
84+
</>
85+
)}
86+
87+
{!isDarkModeEnabled && (
88+
<>
89+
<RxMoon /> Use dark mode
90+
</>
91+
)}
8292
</button>
8393
</div>
8494
</Application.Column>

layouts/Application/components/Footer/style.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@
4848
.AppFooter__Actions {
4949
align-items: center;
5050
display: flex;
51+
flex-wrap: wrap;
52+
gap: 1em;
5153
justify-content: space-between;
54+
padding: 1em 0;
5255
}
5356

5457
.AppFooter__Links {
5558
display: flex;
56-
margin: 1em 0;
5759

5860
list-style-type: none;
5961
}
@@ -74,7 +76,9 @@
7476
border-radius: 100%;
7577
color: var(--c-yellow-11);
7678

77-
transition: background-color ease-in 150ms, border-color ease-in 150ms;
79+
transition:
80+
background-color ease-in 150ms,
81+
border-color ease-in 150ms;
7882
}
7983

8084
.AppFooter__Links__Link:hover {
@@ -87,15 +91,19 @@
8791
border: 2px solid var(--c-gray-7);
8892
display: flex;
8993
font-size: var(--fs-s);
94+
gap: 0.5em;
9095
justify-content: center;
9196
padding: 0.5em;
9297

9398
background-color: var(--c-gray-3);
94-
border-radius: 100%;
99+
border-radius: 99999999px;
95100
color: var(--c-gray-11);
96101
cursor: pointer;
102+
font-family: var(--ff-sans-serif);
97103

98-
transition: background-color ease-in 150ms, border-color ease-in 150ms;
104+
transition:
105+
background-color ease-in 150ms,
106+
border-color ease-in 150ms;
99107
}
100108

101109
.AppFooter__DarkModeToggle:hover {

0 commit comments

Comments
 (0)