Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 596ea5a

Browse files
Adding local storage
1 parent fb68d82 commit 596ea5a

File tree

7 files changed

+23
-18
lines changed

7 files changed

+23
-18
lines changed

‎app/js/script.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,15 @@ const disableDarkTheme = () => {
153153
}
154154

155155
if (theme === 'darkTheme'){
156-
enableDarkTheme()
156+
enableDarkTheme();
157+
}else{
158+
disableDarkTheme();
157159
}
158160

159161
// Cuando se aplique el evento click al botón toggle, si el local storage 'theme' no es 'darkTheme', lo habilitamos y sino lo deshabilitamos.
160162
toggleTheme.addEventListener('click', () => {
163+
// Actualizamos el local storage cuando se hace click.
164+
theme = localStorage.getItem('theme');
161165
if (theme != 'darkTheme'){
162166
enableDarkTheme();
163167
}else{

‎app/scss/components/header.scss

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ header{
6262

6363
.label{
6464
@include flex(space-between, center, row);
65-
width: 52px;
65+
width: 54px;
6666
height: 30px;
6767
padding: .125rem .5rem;
6868
background-color: var(--clr-social-1);
@@ -71,16 +71,6 @@ header{
7171

7272
i{
7373
font-size: 15px;
74-
75-
&.fa{
76-
&-moon{
77-
color: #fadadd;
78-
}
79-
80-
&-sun{
81-
color: #f8f1ae;
82-
}
83-
}
8474
}
8575

8676
.ball{

‎dist/script.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/script.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /