Night Mode using CSS and JavaScript
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
3
down vote
favorite
I just added a new feature to my portfolio: Night Mode. I created it with CSS and session storage in JavaScript. I want you to review my CSS of night files, I feel it's filled with !important
and I'm sure this is a bad practice. Can anyone help me make them better?
My second question, the default mode (white mode) runs in the first milliseconds when moving from page to another. I think it's not a good practice. Can anyone help me make it better?
Live: just set the session to night using this JavaScript line sessionStorage.setItem("mode", "night");
and refresh.
Alll files.
CSS files:
body
background-color: black;
color: white;
.indx-contnt p
color: white !important;
.signature span, a
color: white;
h1
color:#f90 !important;
.latest li span
color: black !important;
.latest li a
color:white !important;
.contentlist li:nth-child(2) a
color:#2CAAE1 !important;
.contentlist li:nth-child(3) a
color:#0177B5 !important;
.contentlist li:nth-child(1) a
color:#717171 !important;
#rss
background-color: black;
.signature span, a
color: white !important;
.latest li a:hover
color: #f90 !important;
p, h1, h2,h4,span
color: white;
body
background-color: black;
color: white;
.signature span, a
color: white !important;
p, h1, h2, h4, span
color: white !important;
.project span
color: black !important;
.card
background-color: #ffffff0f !important;
.card:hover
box-shadow: 10px 7px 10px 0px rgb(255, 153, 0) !important;
.card a
background-color: black !important;
#rss
background-color: black !important;
.card-title
color: #f90 !important;
.posts a
color: white !important;
javascript css
add a comment |Â
up vote
3
down vote
favorite
I just added a new feature to my portfolio: Night Mode. I created it with CSS and session storage in JavaScript. I want you to review my CSS of night files, I feel it's filled with !important
and I'm sure this is a bad practice. Can anyone help me make them better?
My second question, the default mode (white mode) runs in the first milliseconds when moving from page to another. I think it's not a good practice. Can anyone help me make it better?
Live: just set the session to night using this JavaScript line sessionStorage.setItem("mode", "night");
and refresh.
Alll files.
CSS files:
body
background-color: black;
color: white;
.indx-contnt p
color: white !important;
.signature span, a
color: white;
h1
color:#f90 !important;
.latest li span
color: black !important;
.latest li a
color:white !important;
.contentlist li:nth-child(2) a
color:#2CAAE1 !important;
.contentlist li:nth-child(3) a
color:#0177B5 !important;
.contentlist li:nth-child(1) a
color:#717171 !important;
#rss
background-color: black;
.signature span, a
color: white !important;
.latest li a:hover
color: #f90 !important;
p, h1, h2,h4,span
color: white;
body
background-color: black;
color: white;
.signature span, a
color: white !important;
p, h1, h2, h4, span
color: white !important;
.project span
color: black !important;
.card
background-color: #ffffff0f !important;
.card:hover
box-shadow: 10px 7px 10px 0px rgb(255, 153, 0) !important;
.card a
background-color: black !important;
#rss
background-color: black !important;
.card-title
color: #f90 !important;
.posts a
color: white !important;
javascript css
1
You have quite a few elements where you specify only one of background and foreground - that can interact very badly with the user's stylesheet (e.g. yourp color: white !important;
when user hasp background-color: white; color: black;
).
â Toby Speight
May 22 at 8:22
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I just added a new feature to my portfolio: Night Mode. I created it with CSS and session storage in JavaScript. I want you to review my CSS of night files, I feel it's filled with !important
and I'm sure this is a bad practice. Can anyone help me make them better?
My second question, the default mode (white mode) runs in the first milliseconds when moving from page to another. I think it's not a good practice. Can anyone help me make it better?
Live: just set the session to night using this JavaScript line sessionStorage.setItem("mode", "night");
and refresh.
Alll files.
CSS files:
body
background-color: black;
color: white;
.indx-contnt p
color: white !important;
.signature span, a
color: white;
h1
color:#f90 !important;
.latest li span
color: black !important;
.latest li a
color:white !important;
.contentlist li:nth-child(2) a
color:#2CAAE1 !important;
.contentlist li:nth-child(3) a
color:#0177B5 !important;
.contentlist li:nth-child(1) a
color:#717171 !important;
#rss
background-color: black;
.signature span, a
color: white !important;
.latest li a:hover
color: #f90 !important;
p, h1, h2,h4,span
color: white;
body
background-color: black;
color: white;
.signature span, a
color: white !important;
p, h1, h2, h4, span
color: white !important;
.project span
color: black !important;
.card
background-color: #ffffff0f !important;
.card:hover
box-shadow: 10px 7px 10px 0px rgb(255, 153, 0) !important;
.card a
background-color: black !important;
#rss
background-color: black !important;
.card-title
color: #f90 !important;
.posts a
color: white !important;
javascript css
I just added a new feature to my portfolio: Night Mode. I created it with CSS and session storage in JavaScript. I want you to review my CSS of night files, I feel it's filled with !important
and I'm sure this is a bad practice. Can anyone help me make them better?
My second question, the default mode (white mode) runs in the first milliseconds when moving from page to another. I think it's not a good practice. Can anyone help me make it better?
Live: just set the session to night using this JavaScript line sessionStorage.setItem("mode", "night");
and refresh.
Alll files.
CSS files:
body
background-color: black;
color: white;
.indx-contnt p
color: white !important;
.signature span, a
color: white;
h1
color:#f90 !important;
.latest li span
color: black !important;
.latest li a
color:white !important;
.contentlist li:nth-child(2) a
color:#2CAAE1 !important;
.contentlist li:nth-child(3) a
color:#0177B5 !important;
.contentlist li:nth-child(1) a
color:#717171 !important;
#rss
background-color: black;
.signature span, a
color: white !important;
.latest li a:hover
color: #f90 !important;
p, h1, h2,h4,span
color: white;
body
background-color: black;
color: white;
.signature span, a
color: white !important;
p, h1, h2, h4, span
color: white !important;
.project span
color: black !important;
.card
background-color: #ffffff0f !important;
.card:hover
box-shadow: 10px 7px 10px 0px rgb(255, 153, 0) !important;
.card a
background-color: black !important;
#rss
background-color: black !important;
.card-title
color: #f90 !important;
.posts a
color: white !important;
body
background-color: black;
color: white;
.indx-contnt p
color: white !important;
.signature span, a
color: white;
h1
color:#f90 !important;
.latest li span
color: black !important;
.latest li a
color:white !important;
.contentlist li:nth-child(2) a
color:#2CAAE1 !important;
.contentlist li:nth-child(3) a
color:#0177B5 !important;
.contentlist li:nth-child(1) a
color:#717171 !important;
#rss
background-color: black;
.signature span, a
color: white !important;
.latest li a:hover
color: #f90 !important;
p, h1, h2,h4,span
color: white;
body
background-color: black;
color: white;
.indx-contnt p
color: white !important;
.signature span, a
color: white;
h1
color:#f90 !important;
.latest li span
color: black !important;
.latest li a
color:white !important;
.contentlist li:nth-child(2) a
color:#2CAAE1 !important;
.contentlist li:nth-child(3) a
color:#0177B5 !important;
.contentlist li:nth-child(1) a
color:#717171 !important;
#rss
background-color: black;
.signature span, a
color: white !important;
.latest li a:hover
color: #f90 !important;
p, h1, h2,h4,span
color: white;
body
background-color: black;
color: white;
.signature span, a
color: white !important;
p, h1, h2, h4, span
color: white !important;
.project span
color: black !important;
.card
background-color: #ffffff0f !important;
.card:hover
box-shadow: 10px 7px 10px 0px rgb(255, 153, 0) !important;
.card a
background-color: black !important;
#rss
background-color: black !important;
.card-title
color: #f90 !important;
.posts a
color: white !important;
body
background-color: black;
color: white;
.signature span, a
color: white !important;
p, h1, h2, h4, span
color: white !important;
.project span
color: black !important;
.card
background-color: #ffffff0f !important;
.card:hover
box-shadow: 10px 7px 10px 0px rgb(255, 153, 0) !important;
.card a
background-color: black !important;
#rss
background-color: black !important;
.card-title
color: #f90 !important;
.posts a
color: white !important;
javascript css
edited May 22 at 9:38
Mast
7,32663484
7,32663484
asked May 22 at 5:18
Zeyad Etman
1161
1161
1
You have quite a few elements where you specify only one of background and foreground - that can interact very badly with the user's stylesheet (e.g. yourp color: white !important;
when user hasp background-color: white; color: black;
).
â Toby Speight
May 22 at 8:22
add a comment |Â
1
You have quite a few elements where you specify only one of background and foreground - that can interact very badly with the user's stylesheet (e.g. yourp color: white !important;
when user hasp background-color: white; color: black;
).
â Toby Speight
May 22 at 8:22
1
1
You have quite a few elements where you specify only one of background and foreground - that can interact very badly with the user's stylesheet (e.g. your
p color: white !important;
when user has p background-color: white; color: black;
).â Toby Speight
May 22 at 8:22
You have quite a few elements where you specify only one of background and foreground - that can interact very badly with the user's stylesheet (e.g. your
p color: white !important;
when user has p background-color: white; color: black;
).â Toby Speight
May 22 at 8:22
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f194921%2fnight-mode-using-css-and-javascript%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
You have quite a few elements where you specify only one of background and foreground - that can interact very badly with the user's stylesheet (e.g. your
p color: white !important;
when user hasp background-color: white; color: black;
).â Toby Speight
May 22 at 8:22