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.
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;
}
p { color: white !important; }
when user hasp { background-color: white; color: black; }
). \$\endgroup\$