b8ec177877
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
105 lines
2.0 KiB
CSS
105 lines
2.0 KiB
CSS
:root {
|
|
--nav-bg-color: black;
|
|
--nav-text-color: white;
|
|
--nav-header-bg-color: #0f0;
|
|
--nav-header-text-color: black;
|
|
--nav-link-active-text-color: white;
|
|
--nav-link-active-bg-color: var(--main-bg-color, #404040);
|
|
}
|
|
|
|
@media screen and (prefers-color-scheme: light) {
|
|
:root {
|
|
--nav-bg-color: black;
|
|
--nav-text-color: white;
|
|
--nav-header-bg-color: #0f0;
|
|
--nav-header-text-color: black;
|
|
--nav-link-active-text-color: black;
|
|
--nav-link-active-bg-color: var(--main-bg-color, white);
|
|
}
|
|
}
|
|
|
|
nav {
|
|
overflow: hidden;
|
|
background-color: var(--nav-bg-color);
|
|
color: var(--nav-text-color);
|
|
font-size: larger;
|
|
}
|
|
|
|
nav h1 {
|
|
font-size: 18px;
|
|
margin: 0px;
|
|
background-color: var(--nav-header-bg-color);
|
|
color: var(--nav-header-text-color);
|
|
}
|
|
|
|
nav a, nav h1, nav label {
|
|
text-align: left;
|
|
padding: 8px 10px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
#hamnav label, #hamburger {
|
|
display: none;
|
|
}
|
|
|
|
@media screen and (min-width: 600px){
|
|
#hamitems a:hover, #hamitems a[aria-current="true"], #hamitems:hover a[aria-current="true"]:hover {
|
|
color: var(--nav-link-active-text-color);
|
|
background-color: var(--nav-link-active-bg-color);
|
|
}
|
|
|
|
#hamitems:hover a[aria-current="true"] {
|
|
color: var(--nav-text-color);
|
|
background-color: var(--nav-bg-color);
|
|
}
|
|
|
|
nav {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
#hamitems {
|
|
display: flex;
|
|
}
|
|
}
|
|
|
|
@media screen and (max-width: 600px){
|
|
nav {
|
|
display: grid;
|
|
grid-template-columns: 1fr auto;
|
|
}
|
|
|
|
#hamitems {
|
|
display: block;
|
|
position: absolute;
|
|
top: 43px;
|
|
right: 0;
|
|
background-color: var(--nav-bg-color);
|
|
}
|
|
|
|
#hamitems a {
|
|
box-sizing: border-box;
|
|
display: block;
|
|
text-align: center;
|
|
width: 100%;
|
|
}
|
|
|
|
#hamnav label {
|
|
display: inline-block;
|
|
}
|
|
|
|
#hamburger ~ #hamitems a {
|
|
height: 0;
|
|
padding: 0 0.5em;
|
|
border: 0;
|
|
transition: height 250ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
visibility: hidden;
|
|
}
|
|
|
|
#hamburger:checked ~ #hamitems a {
|
|
height: 2.5em;
|
|
padding: 0.5em;
|
|
transition: height 250ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
visibility: visible;
|
|
}
|
|
} |