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 { 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; &: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); } } } i { margin-right: 5px; flex-grow: 0; } } .nav-trigger { position: absolute; clip: rect(0, 0, 0, 0); &:checked + nav { width: 0%; } } .nav-top { user-select: none; margin-top: 1rem; display: block; > li { box-shadow: 0 0 10px 3px rgba(90, 71, 114, 0.1); margin-right: .5rem; > 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; } }