Skip to content

Commit

Permalink
fix: improve responsive header layout
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizendae committed Nov 12, 2024
1 parent d0d0e05 commit ac03bcd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ const currentPath = Astro.url.pathname;

<nav
aria-label="Header Navigation"
class="hidden flex-1 flex-row items-center justify-between pl-36 md:flex"
class="hidden flex-row items-center justify-between md:flex lg:pl-12"
>
<ul class="flex flex-row items-center space-x-5">
<ul class="flex flex-row items-center space-x-0.5 lg:space-x-1">
{
navItems.map(item => (
<li>
Expand Down
4 changes: 2 additions & 2 deletions src/components/search.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { Icon } from "astro-icon/components";
aria-label="Open search"
aria-controls="search-dialog"
aria-expanded="false"
class="focus:ring-primary-500 inline-flex items-center space-x-2 rounded-md px-4 py-2 text-sm text-gray-600 hover:text-black"
class="focus:ring-primary-500 inline-flex items-center space-x-2 rounded-md py-2 pl-4 text-sm text-gray-600 hover:text-black"
>
<Icon name="search" class="h-5 w-5" />
<span> Search </span>
<span class="hidden lg:block"> Search </span>
</button>

<!-- Search dialog -->
Expand Down
8 changes: 7 additions & 1 deletion src/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ h1, h2, h3, h4, h5, h6 {
}

.container {
@apply mx-auto w-full max-w-screen-xl px-3 md:px-0;
@apply mx-auto w-full
max-w-[90rem] /* 1440px max-width */
sm:max-w-[640px]
md:max-w-[768px]
lg:max-w-[896px] /* ~1024px - 128px margins */
xl:max-w-[1024px] /* ~1280px - 256px margins */
2xl:max-w-[1200px]; /* ~1440px - 240px margins */
}


Expand Down

0 comments on commit ac03bcd

Please sign in to comment.