Skip to content

Commit 638765e

Browse files
committed
feat: add navbar
1 parent 7559a36 commit 638765e

4 files changed

Lines changed: 93 additions & 1 deletion

File tree

packages/panda-san/.stylelintrc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
],
55
"extends": "stylelint-config-sass-guidelines",
66
"rules": {
7-
"max-nesting-depth": 2
7+
"max-nesting-depth": 3,
8+
"order/order": [
9+
"custom-properties",
10+
"declarations"
11+
]
812
}
913
}

packages/panda-san/src/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
@import 'mixins/index';
33
@import 'core/index';
44
@import 'layout/index';
5+
@import 'navbar/index';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import 'navbar';
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
.navbar {
2+
align-items: center;
3+
background-color: $navbar-color;
4+
display: flex;
5+
flex-wrap: wrap;
6+
justify-content: space-between;
7+
width: 100%;
8+
z-index: $stack-sticky;
9+
10+
&__brand {
11+
display: flex;
12+
flex: 1;
13+
}
14+
15+
&__burger {
16+
display: flex;
17+
flex: 1;
18+
justify-content: flex-end;
19+
20+
button {
21+
background: none;
22+
border: 0;
23+
}
24+
}
25+
26+
&__menu {
27+
display: none;
28+
29+
&--active {
30+
background-color: $navbar-menu-color;
31+
display: flex;
32+
flex-direction: column;
33+
width: 100%;
34+
}
35+
}
36+
37+
&__item {
38+
align-items: center;
39+
color: $link-color;
40+
display: flex;
41+
height: px-to-rem(36px);
42+
justify-content: flex-start;
43+
text-decoration: none;
44+
width: 100%;
45+
46+
&:hover,
47+
&:focus {
48+
background-color: darken($navbar-menu-color, 10%);
49+
}
50+
}
51+
52+
@each $breakpoint-name, $gutter in $container-gutters {
53+
@include breakpoint($breakpoint-name) {
54+
padding: $gutter $gutter;
55+
}
56+
}
57+
58+
@include breakpoint(tablet) {
59+
&__burger {
60+
display: none;
61+
}
62+
63+
&__menu,
64+
&__menu--active {
65+
background-color: transparent;
66+
display: flex;
67+
flex: 2;
68+
flex-direction: row;
69+
justify-content: flex-end;
70+
}
71+
72+
&__item {
73+
justify-content: center;
74+
width: fit-content;
75+
76+
& + & {
77+
margin-left: px-to-rem(51px);
78+
}
79+
80+
&:hover,
81+
&:focus {
82+
background-color: transparent;
83+
}
84+
}
85+
}
86+
}

0 commit comments

Comments
 (0)