cssOMS/nav.scss

181 lines
3.3 KiB
SCSS

body > nav {
width: 250px;
overflow-y: auto;
font-size: 0.8em;
background: linear-gradient(135deg, var(--nav-category-background-highlight), var(--nav-category-background));
color: rgba(255, 255, 255, 0.8);
}
#nav-side {
flex: 0;
display: flex;
flex-flow: column;
box-sizing: border-box;
span {
width: 20px;
display: inline-block;
}
input {
display: none;
&:checked + ul {
.max {
display: inherit;
}
.min {
display: none;
}
> li:nth-child(n+2) {
display: inherit;
}
}
}
input + ul {
.min, .max {
margin-left: 1rem;
float: right;
}
.max {
display: none;
}
.min {
display: inherit;
}
> li:nth-child(n+2) {
display: none;
}
}
label {
display: block;
padding: .5rem 1rem .5rem 1rem;
cursor: pointer;
}
> li {
display: block;
a {
display: block;
padding: .5rem 1rem .5rem 1rem;
&:hover {
background: var(--nav-sub-background-hover);
}
}
li {
&:not(:first-child) {
background: linear-gradient(to right, var(--nav-sub-background-highlight), var(--nav-sub-background));
}
&:hover, &.active {
background: var(--nav-category-background-hover);
}
}
}
.max, .min {
float: right;
}
i {
margin-right: 5px;
}
}
.nav-trigger {
position: absolute;
clip: rect(0, 0, 0, 0);
&:checked + nav {
width: 0%;
}
}
.nav-top {
user-select: none;
margin-top: 1rem;
display: block;
background: #fff;
border: 1px solid var(--box-border);
> li {
> a {
display: inline-block;
padding: 10px 10px;
}
}
li {
background: #fff;
display: inline-block;
position: relative;
cursor: pointer;
&:hover, &.active {
background: var(--nav-content-hover);
color: var(--text-on-background-color-2);
> ul {
display: block;
opacity: 1;
visibility: visible;
}
}
> ul {
padding: 0;
z-index: 5;
position: absolute;
top: 36px;
left: 0;
width: 150px;
display: none;
opacity: 0;
visibility: hidden;
li {
display: block;
color: #000;
padding: 7px;
&:hover {
color: #252525;
background: var(--nav-content-hover);
}
}
}
}
}
@media only screen and (max-width: 800px) {
#nav-trigger:not(:checked) + nav {
width: 0%;
}
#nav-trigger:checked + nav {
width: auto;
min-width: 250px;
}
}
@media only screen and (max-width: 500px) {
#nav-trigger:checked + nav {
width: 100%;
}
#nav-trigger:checked ~ main {
display: none;
}
}