--- import headerimg from "../../static/link_192.png" --- <header> <a href={Astro.site} rel="noopener noreferrer" aria-label="Home"> <img src={headerimg} alt=""> </a> <ul class="desktop"> <slot /> </ul> <button class="mobile"> <ul> <slot /> </ul> <div class="placeholder"></div> <i class="iconoir-menu"></i> </button> </header> <style> header { background-color: #1e1e1e; display: flex; height: auto; width: 100%; align-items: center; line-height: 1.5em; } header > a { padding-left: 16px; display: block; height: 48px; width: 48px; } a > img { height: 100%; width: 100%; object-fit: contain; } .desktop { align-items: center; justify-content: space-around; display: none; flex-wrap: wrap; flex-direction: row; height: 64px; width: 100%; list-style-type: none; row-gap: 0.5em; column-gap: 0.5ch; margin: 0px; line-height: 1.5em; } .mobile > ul { background-color: #1e1e1e; align-items: center; flex-wrap: wrap; flex-direction: column; display: flex; width: 100%; list-style-type: none; line-height: 3em; } .placeholder { display: flex; width: 100%; } .mobile { display:flex; background-color: #1e1e1e; border: 0px; width: 100%; height: 64px; } .mobile > i { color: white; font-weight: bold; font-size: 2em; align-self: center; padding-right: 1em; } .mobile > ul { display: none; padding: 0px; } .mobile:focus-within > ul{ display: flex; } .mobile:focus-within > .placeholder{ display: none; } .mobile:focus-within { height: 256px; } @media (min-width: 1120px) { .mobile { display:none; } .desktop { display: flex; } header { height: 64px; } } </style>