www-new/components/Navbar.module.css

152 lines
2.3 KiB
CSS

.navbar {
display: flex;
justify-content: center;
align-items: center;
background-color: var(--white);
}
.navContent {
display: flex;
flex-direction: row;
flex-wrap: none;
justify-content: space-between;
align-items: center;
width: stretch;
max-width: 1440px;
height: auto;
padding: 1.75rem 8.5rem;
}
.logo {
display: flex;
justify-content: center;
align-items: center;
}
.logo:hover {
cursor: pointer;
}
.logo img {
width: 96px;
}
.navMenu {
display: inline-flex;
flex-direction: row;
flex-wrap: none;
justify-content: space-between;
align-items: baseline;
margin: 0;
padding: 0;
width: 32rem;
}
.navMenu li {
list-style: none;
text-align: center;
}
.navMenu a {
color: var(--purple-2);
text-decoration: none;
}
.navMenu a.currentPage {
color: var(--blue-2);
}
.navMenu > li:hover > a {
color: var(--blue-2);
font-weight: 600;
}
/* Prevents the menu items from shifting when made bold on hover */
.navMenu > li > a::before {
display: block;
content: attr(title);
font-weight: 600;
height: 0;
overflow: hidden;
visibility: hidden;
}
.navMenu > li > a {
padding: 1rem;
}
.dropdownWrapper {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}
.dropdown {
visibility: visible;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
position: absolute;
margin: 0;
margin-top: 3rem;
padding: 0;
border-radius: 0.5rem;
background-color: var(--white);
box-shadow: 0 0.5rem 1rem var(--blue-1-20);
font-size: 0.875rem;
}
.dropdown > li {
width: 100%;
}
.dropdown > li > a {
padding: 0.5rem;
width: 100%;
box-sizing: border-box;
}
.dropdown > li:hover > a,
.dropdown > li > a:focus {
background-color: var(--blue-1-20);
}
.dropdown > li:first-child > a {
padding-top: 1rem;
border-radius: 0.5rem 0.5rem 0 0;
}
.dropdown > li:last-child > a {
padding-bottom: 1rem;
border-radius: 0 0 0.5rem 0.5rem;
}
.navMenu > li .dropdown {
visibility: hidden;
}
.navMenu > li:hover .dropdown,
.navMenu > li:focus-within .dropdown {
visibility: visible;
}
/* On a smaller desktop screen, keep the same navbar layout but decrease the
* horizontal padding so it still fits
*/
@media screen and (max-width: 960px) {
.navContent {
padding: 1.75rem 4rem;
}
}