Skip to content

Commit

Permalink
Fixes performance
Browse files Browse the repository at this point in the history
  • Loading branch information
dragoss-nc committed Dec 10, 2024
1 parent caa39ef commit 31d64b7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
36 changes: 25 additions & 11 deletions blocks/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
header {
--header-border-bottom-size: 2px;

display: flex;
align-items: center;
border-bottom: var(--header-border-bottom-size) solid var(--col-neutral20);

@media (min-width: 1280px) {
align-items: flex-end;
}
}

.header {
flex: 1;
}

.nav-wrapper {
Expand All @@ -11,24 +21,19 @@ header {
}

.nav {
--nav-padding-block: 26px;
--nav-gap: 0 26px;

box-sizing: border-box;
display: grid;
grid-template:
'brand tools hamburger' var(--nav-height) / auto 1fr auto;
'brand tools hamburger' 1fr / auto 1fr auto;
align-items: center;
gap: 26px;
gap: var(--nav-gap);
margin: auto;
max-width: var(--content-max-width);
height: var(--nav-height);
padding-block: var(--nav-padding-block);
padding-inline: var(--content-padding-inline);
font-family: var(--body-font-family);

@media (min-width: 1280px) {
--nav-padding-block: 26px 0;
}

&[aria-expanded='true'] {
grid-template:
'brand hamburger' var(--nav-height)
Expand All @@ -44,10 +49,11 @@ header {
}

@media (min-width: 1280px) {
--nav-gap: 16px;

grid-template:
'brand tools' var(--nav-height)
'brand tools' auto
'sections sections' 1fr / 1fr auto;
min-height: 0;
overflow: visible;
}
}
Expand Down Expand Up @@ -361,11 +367,15 @@ header {
/* tools */
.nav-tools {
--nav-tools-gap: 12px;
--nav-tools-padding-block: 20px;

display: none;
grid-area: tools;
padding-block: var(--nav-tools-padding-block);

@media (min-width: 768px) {
--nav-tools-padding-block: 0;

display: block;
}

Expand Down Expand Up @@ -412,5 +422,9 @@ header {
nav[aria-expanded='true'] & {
display: block;
align-self: flex-start;

@media (min-width: 768px) {
align-self: auto;
}
}
}
15 changes: 7 additions & 8 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
}

/* nav height */
--nav-height: auto;
--nav-height: 80px;

/* DN Theme variables */

Expand Down Expand Up @@ -139,8 +139,11 @@ body.appear {
}

header {
height: var(--nav-height);
min-height: 84px;
min-height: var(--nav-height);

@media (min-width: 1280px) {
--nav-height: 105px;
}
}

header .header,
Expand Down Expand Up @@ -390,11 +393,7 @@ button.button--tertiary:disabled:hover {

main img {
max-width: 100%;

/* width: auto; */
/* height: auto; */

height: 100%;
height: auto;
}

main {
Expand Down

0 comments on commit 31d64b7

Please sign in to comment.