This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/src/assets/styles/components/menu.css

130 lines
No EOL
2.2 KiB
CSS

.menu-primary {
display: flex;
flex-direction: row;
list-style-type: none;
padding: 0;
gap: var(--sizing-md);
& > li {
margin: 0;
display: flex;
& .icon > svg,
& .active > svg {
display: block;
}
& .icon > span,
& .active > span {
display: none;
}
}
}
.menu-button-container {
display: none;
margin-left: var(--sizing-md);
& .menu-open,
& .menu-closed {
cursor: pointer;
}
& svg {
transform: rotate(0deg);
transition-property: transform;
transition-timing-function: var(--transition-ease-in-out);
transition-duration: var(--transition-duration-default);
}
& svg:hover,
& svg:active,
& svg:focus {
stroke: var(--accent-color-hover);
transform: rotate(8deg);
}
}
#menu-toggle {
display: none;
}
#menu-toggle:checked + .menu-button-container {
& .menu-closed {
display: none;
}
& .menu-open {
display: block;
}
}
#menu-toggle:not(:checked) + .menu-button-container {
& .menu-closed {
display: block;
}
& .menu-open {
display: none;
}
}
@media (max-width: 768px) {
.menu-primary {
position: absolute;
top: 0;
left: 0;
gap: 0;
margin-top: calc(var(--sizing-3xl) * 2.25);
flex-direction: column;
width: 100%;
z-index: 3;
& > li {
overflow: hidden;
align-items: center;
justify-content: center;
margin: 0;
padding: var(--sizing-sm) 0;
width: 100%;
color: var(--text-color);
background: var(--background-color);
& .icon > svg,
& .active > svg {
display: none;
}
& .icon > span,
& .active > span {
display: inline;
}
}
}
#menu-toggle ~ .menu-primary li {
height: 0;
border: 0;
padding: 0;
}
#menu-toggle:checked ~ .menu-primary li {
border-bottom: 1px solid var(--gray-light);
height: calc(var(--sizing-3xl) * 1.5);
&:first-child {
border-top: 1px solid var(--gray-light);
}
& a,
& .active {
font-size: var(--font-size-lg);
}
}
.menu-button-container {
display: unset;
width: var(--sizing-svg-base);
height: var(--sizing-svg-base);
}
}