Skip to content

Commit 273a8e4

Browse files
style desktop nav items
1 parent 978a7da commit 273a8e4

File tree

7 files changed

+66
-57
lines changed

7 files changed

+66
-57
lines changed

src/features/common/components/headers/header/header.component.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ export const HeaderComponent: React.FC<HeaderComponentProps> = ({
3434
: createUrlPath([languageCode]);
3535

3636
return (
37-
<header className={styles.header}>
38-
<BoxComponent
39-
contentAs="nav"
40-
containerClassName={styles.container}
41-
wrapperClassName={styles.wrapper}
42-
contentClassName={styles.content}
43-
aria-label="Main navigation"
44-
>
37+
<BoxComponent
38+
contentAs="nav"
39+
containerClassName={styles.container}
40+
wrapperClassName={styles.wrapper}
41+
contentClassName={styles.content}
42+
aria-label="Main navigation"
43+
>
44+
<div className={styles.brand}>
4545
<SiteBrandComponent path={languagePathPrefix} languageCode={languageCode} />
46+
</div>
47+
<div className={styles.navContainer}>
4648
<div className={styles.navTabs}>
4749
<ul className={styles.navList}>
4850
{dictionary.links.map((link) => {
@@ -70,7 +72,7 @@ export const HeaderComponent: React.FC<HeaderComponentProps> = ({
7072
})}
7173
</ul>
7274
</div>
73-
</BoxComponent>
74-
</header>
75+
</div>
76+
</BoxComponent>
7577
);
7678
};

src/features/common/components/headers/header/header.module.scss

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
@use "@/libs/theme/styles/variables" as *;
22
@use "@/libs/theme/styles/mixins" as *;
33

4-
.header {
5-
position: fixed;
6-
top: 0;
7-
right: 0;
8-
left: 0;
9-
10-
z-index: 9001;
11-
backdrop-filter: blur(2rem);
12-
}
13-
144
.container {
155
@include Container;
6+
max-width: calc(100% - 2rem);
167
display: none;
17-
8+
position: fixed;
9+
top: 1rem;
10+
right: 0;
11+
left: 0;
12+
border-radius: 1.25rem;
13+
margin: 0 auto;
14+
box-sizing: border-box;
1815
background: var(--color_bg_app_bar);
19-
border-bottom: 1px solid rgba(#555, 0.32);
16+
border: 1px solid var(--color_bg_app_bar);
17+
box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .04);
18+
backdrop-filter: blur(3rem);
19+
z-index: 100;
2020

2121
@media #{$breakpoint-dimension-sm} {
2222
display: block;
@@ -29,68 +29,75 @@
2929
}
3030

3131
.content {
32-
@include InnerContentFlex;
32+
display: flex;
33+
width: 100%;
34+
margin: 0 auto;
3335
height: 100%;
3436
position: relative;
35-
grid-column: 1 / -1;
3637
align-items: center;
3738
justify-content: space-between;
3839
}
3940

41+
.brand {
42+
display: flex;
43+
align-items: center;
44+
height: 1rem;
45+
margin-left: 1.5rem;
46+
z-index: 100;
47+
}
48+
49+
.navContainer {
50+
display: flex;
51+
justify-content: center;
52+
width: 100%;
53+
position: absolute;
54+
left: 0;
55+
}
56+
4057
.navTabs {
41-
flex: 1;
4258
display: flex;
4359
align-items: center;
4460
justify-content: center;
45-
gap: 3rem;
61+
border-radius: 9999px;
62+
padding: .25rem;
4663
}
4764

4865
.navList {
4966
display: flex;
5067
padding: 0;
5168
list-style-type: none;
5269
margin: 0;
53-
5470
height: 100%;
55-
56-
@media #{$breakpoint-dimension-sm} {
57-
gap: 2rem;
58-
}
59-
60-
@media #{$breakpoint-dimension-md} {
61-
gap: 3rem;
62-
}
71+
gap: 0.25rem;
6372
}
6473

6574
.navList__item {
6675
position: relative;
67-
border-bottom: 0.125rem solid transparent;
68-
color: var(--color_fg_link);
6976

7077
&[data-active="true"] {
71-
color: var(--color_fg_selected);
72-
border-bottom: 1px solid var(--color_border_selected);
78+
a {
79+
background-color: var(--color_bg_app_bar);
80+
color: var(--color_fg_bold);
81+
cursor: default;
82+
}
7383
}
7484
}
7585

76-
.navList__item,
7786
.navList__item > a {
7887
display: flex;
7988
align-items: center;
80-
81-
font-size: 0.875rem;
89+
padding: .5rem 1rem;
90+
color: var(--color_fg_default);
91+
font-size: .875rem;
8292
font-style: normal;
83-
font-weight: 500;
84-
line-height: 1.5rem;
85-
letter-spacing: 0.2px;
93+
font-weight: 600;
94+
line-height: 1.5;
95+
letter-spacing: -.1px;
96+
border-radius: 9999px;
8697

8798
&:focus-visible {
8899
outline: solid 1px var(--color_border_focus);
89100
outline-offset: 0.125rem;
90101
border-radius: 0.125rem;
91102
}
92103
}
93-
94-
.header_actions {
95-
96-
}

src/features/common/components/headers/mobile-header/mobile-header.component.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export const MobileHeaderComponent: React.FC<MobileHeaderComponentProps> = ({
7676

7777
return (
7878
<>
79-
<header className={styles.header}>
8079
<BoxComponent
8180
contentAs="nav"
8281
containerClassName={styles.container}
@@ -102,7 +101,6 @@ export const MobileHeaderComponent: React.FC<MobileHeaderComponentProps> = ({
102101
/>
103102
</button>
104103
</BoxComponent>
105-
</header>
106104
<section
107105
className={styles.menu}
108106
aria-hidden={mobileMenuState === MobileMenuStateValues.CLOSED}

src/features/common/components/headers/mobile-header/mobile-header.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
border: 1px solid var(--color_bg_app_bar_border);
1414
backdrop-filter: blur(2rem);
1515
z-index: 100;
16+
17+
@media #{$breakpoint-dimension-sm} {
18+
display: none;
19+
}
1620
}
1721

1822
.wrapper {

src/features/common/components/layout/page-header/page-header.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const PageHeaderComponent: React.FC<PageHeaderComponentProps> = ({
1717
const layoutDictionary = getLayoutDictionary(languageCode);
1818

1919
return (
20-
<>
20+
<header>
2121
<MobileHeaderComponent
2222
languageCode={languageCode}
2323
dictionary={layoutDictionary.header}
@@ -26,6 +26,6 @@ export const PageHeaderComponent: React.FC<PageHeaderComponentProps> = ({
2626
languageCode={languageCode}
2727
dictionary={layoutDictionary.header}
2828
/>
29-
</>
29+
</header>
3030
);
3131
};

src/libs/theme/styles/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ $gradient-app-card---resting: linear-gradient(
150150

151151
$ribbon-height: 2.5rem;
152152
$ribbon-height-mobile: 2.5rem;
153-
$navbar-height: 3rem;
153+
$navbar-height: 5rem;
154154
$navbar-height-mobile: 3rem;
155155
$main-nav-height: calc($ribbon-height + $navbar-height);
156156
$main-nav-height-mobile: calc($ribbon-height-mobile + $navbar-height-mobile);

src/libs/theme/styles/globals.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
:root {
4646
--color_bg_page: var(--functional-gray-950);
4747
--color_fg_bold: var(--functional-gray-50);
48-
--color_fg_default: var(--functional-gray-200);
48+
--color_fg_default: var(--functional-gray-500);
4949
--color_fg_link_primary: var(--cloud);
5050

5151
--color_bg_app_bar: hsla(0,0%,7%,.04);
@@ -196,10 +196,8 @@ html[data-theme="system-light"] {
196196

197197
--color_bg_page: var(--functional-gray-0);
198198
--color_fg_bold: var(--charcoal2);
199-
--color_fg_default: var(--functional-gray-650);
200199
--color_fg_link_primary: var(--sky);
201200

202-
--color_bg_app_bar: rgba(241, 241, 241, 0.66);
203201
--color_bg_app_bar_plain: rgba(241, 241, 241);
204202

205203
--color_fg_link: var(--charcoal2);

0 commit comments

Comments
 (0)