cssOMS/nav.scss
2022-08-16 19:04:57 +02:00

216 lines
4.3 KiB
SCSS
Executable File

body > nav {
width: 250px;
overflow-y: auto;
font-size: 0.8em;
background: var(--nav-category-background);
color: rgba(255, 255, 255, 0.8);
flex-shrink: 0;
display: flex;
flex-direction: column;
user-select: none;
}
#nav-side-outer {
overflow-y: auto;
height: 100%;
user-select: none;
scrollbar-color: var(--button-colored-background) var(--nav-category-background);
scrollbar-width: thin;
&::-webkit-scrollbar {
width: 7px;
}
&::-webkit-scrollbar-thumb {
background: var(--button-colored-background);
}
&::-webkit-scrollbar-track {
background: var(--nav-category-background);
}
}
#nav-side-inner {
flex: 0;
display: flex;
flex-flow: column;
box-sizing: border-box;
border-top: 1px solid #4b5055;
span {
flex-grow: 1;
}
input {
display: none;
&:checked + ul {
.expand {
transition: all .3s ease;
display: inherit;
transform: rotateZ(90deg);
}
> li:nth-child(n+2) {
display: inherit;
}
}
}
input + ul {
.expand {
font-size: .6rem;
transition: all .3s ease;
margin-left: 1rem;
transform: rotateZ(0deg);
}
> li:nth-child(n+2) {
display: none;
}
}
label {
display: flex;
align-items: center;
padding: .5rem 1rem .5rem 1rem;
cursor: pointer;
}
> li {
display: block;
a {
display: block;
padding: .5rem 1rem .5rem 1rem;
border-left: 3px solid transparent;
&:hover, &:focus {
background: var(--nav-sub-background-hover);
border-left: 3px solid var(--nav-sub-background-highlight);
}
}
li {
&:not(:first-child) {
background: var(--nav-sub-background);
}
a {
&:hover, &.active, &:focus {
background: var(--nav-category-background-hover);
}
}
}
li:first-child {
border-bottom: 1px solid #212628;
}
li:first-child {
border-top: 1px solid #4b5055;
}
}
> li:first-child {
li:first-child {
border-top: none;
}
}
i {
margin-right: 5px;
flex-grow: 0;
}
}
.nav-trigger {
position: absolute;
&:checked + nav {
width: 0%;
}
}
.nav-top {
user-select: none;
margin-top: 1rem;
display: block;
> li {
> a {
//box-shadow: 0 0 3px 1px rgba(90, 71, 114, 0.3);
border: 1px solid var(--box-border);
margin-right: .5rem;
display: inline-block;
padding: 10px 10px;
}
}
li {
display: inline-block;
a {
background: #fff;
position: relative;
cursor: pointer;
&:hover, &.active, &:focus {
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, &:focus {
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;
}
}