Skip to content

Commit 9769b9e

Browse files
adding the fixes (#12)
1 parent 6aa499f commit 9769b9e

File tree

3 files changed

+67
-80
lines changed

3 files changed

+67
-80
lines changed

src/css/nav.css

Lines changed: 60 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
.nav-container {
2+
@include text-caption;
3+
24
position: fixed;
35
top: var(--navbar-height);
46
left: 0;
57
width: 100%;
6-
font-size: calc(17 / var(--rem-base) * 1rem);
78
z-index: var(--z-index-nav);
89
visibility: hidden;
910
}
@@ -16,7 +17,6 @@
1617

1718
@media screen and (min-width: 1024px) {
1819
.nav-container {
19-
/* font-size: calc(14.5 / var(--rem-base) * 1rem); */
2020
flex: none;
2121
position: static;
2222
top: 0;
@@ -75,118 +75,78 @@ html.is-clipped--nav {
7575
opacity: 0.75;
7676
}
7777

78-
/* .nav-panel-menu:not(.is-active)::after {
79-
content: "";
80-
background: rgba(0, 0, 0, 0.5);
81-
display: block;
82-
position: absolute;
83-
top: 0;
84-
right: 0;
85-
bottom: 0;
86-
left: 0;
87-
} */
88-
8978
.nav-menu {
9079
min-height: 100%;
91-
/* padding: 0.5rem 0.5rem 0.75rem var(--site-padding); */
9280
line-height: var(--nav-line-height);
9381
position: relative;
9482
}
9583

96-
/* .nav-menu h3.title {
97-
color: var(--nav-heading-font-color);
98-
font-size: inherit;
99-
font-weight: var(--body-font-weight-bold);
100-
margin: 0;
101-
padding: 0.25em 0 0.125em;
102-
} */
84+
.nav-menu > .nav-list {
85+
gap: var(--ds-space-1);
86+
}
10387

10488
.nav-list {
10589
display: flex;
10690
flex-direction: column;
10791
list-style: none;
10892
padding: 0;
109-
margin: 0
110-
/* margin: 0 0 0 0.75rem;
111-
padding: 0; */
93+
margin: 0;
11294
}
11395

114-
/* .nav-menu > .nav-list + .nav-list {
115-
margin-top: 0.5rem;
116-
} */
117-
11896
.nav-item {
11997
display: flex;
12098
flex-direction: column;
12199
}
122100

123-
/* adds some breathing room below a nested list */
124-
/* .nav-item-toggle ~ .nav-list {
125-
padding-bottom: 0.125rem;
126-
} */
127-
128-
/* matches list without a title */
129-
/* .nav-item[data-depth="0"] > .nav-list:first-child {
130-
display: block;
131-
margin: 0;
132-
} */
133-
134-
.nav-item:not(.is-active) > .nav-list {
135-
display: none;
136-
}
137-
138-
.nav-item-toggle {
139-
background: transparent url(../img/caret.svg) no-repeat center / 50%;
140-
border: none;
141-
outline: none;
142-
line-height: inherit;
143-
padding: 0;
144-
position: absolute;
145-
height: calc(var(--nav-line-height) * 1em);
146-
width: calc(var(--nav-line-height) * 1em);
147-
margin-top: -0.05em;
148-
margin-left: calc(var(--nav-line-height) * -1em);
149-
}
150-
151-
/* .nav-item.is-active > .nav-item-toggle {
152-
transform: rotate(90deg);
153-
} */
154-
155101
.nav-link,
156102
.nav-text {
157-
@include text-caption;
158-
159103
position: relative;
160104
display: flex;
161105
align-items: center;
162-
padding: var(--ds-space-1) var(--ds-space-1) var(--ds-space-1) var(--site-padding);
106+
padding: var(--ds-space-1) var(--site-padding);
107+
}
108+
109+
.nav-link {
163110
transition: var(--ds-transition);
164111

165112
&:hover {
166113
background: var(--ds-neutral-soft-bg);
167114
}
168115

116+
&::after {
117+
font-family: "Material Icons Outlined", sans-serif;
118+
font-weight: 400;
119+
content: "\e5c8";
120+
position: absolute;
121+
right: var(--ds-space-2);
122+
color: var(--ds-text-tertiary);
123+
opacity: 0;
124+
transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
125+
}
126+
127+
&:hover::after {
128+
opacity: 1;
129+
}
130+
169131
&:active {
170132
background: var(--ds-neutral-soft-active-bg);
171133
}
172134
}
173135

174-
.nav-link > .material-icons,
175-
.nav-text > .material-icons {
136+
.nav-link > .material-icons {
176137
font-size: calc(16 / var(--rem-base) * 1rem);
177-
margin-right: calc(8 / var(--rem-base) * 1rem);
138+
margin-right: var(--ds-space-1);
178139
}
179140

180-
li[data-depth="1"] > .nav-link,
181-
li[data-depth="1"] > .nav-text {
141+
.nav-item[data-depth="0"] > .nav-link,
142+
.nav-item[data-depth="0"] > .nav-text {
182143
@include text-overline;
183144

184145
color: var(--ds-text-tertiary);
185146
margin-top: var(--ds-space-1);
186147
}
187148

188-
.is-current-page > .nav-link,
189-
.is-current-page > .nav-text {
149+
.is-current-page > .nav-link {
190150
font-weight: 600;
191151
background: var(--ds-neutral-soft-bg);
192152

@@ -201,15 +161,43 @@ li[data-depth="1"] > .nav-text {
201161
}
202162

203163
.secondary-nav-list {
204-
padding: 0;
205164
margin: 0;
206-
padding-bottom: var(--ds-space-2);
165+
padding: var(--ds-space-2) 0;
207166
}
208167

209168
.secondary-nav-list .nav-item {
210169
color: var(--ds-text-secondary);
211170
}
212171

172+
.secondary-nav-list .nav-link::after {
173+
content: "\e89e";
174+
}
175+
176+
/*** nav-item toggle styles, keeping for now as we might implement again when more content is added ***/
177+
178+
/* .nav-item:not(.is-active) > .nav-list {
179+
display: none;
180+
} */
181+
182+
/* .nav-item-toggle {
183+
background: transparent url(../img/caret.svg) no-repeat center / 50%;
184+
border: none;
185+
outline: none;
186+
line-height: inherit;
187+
padding: 0;
188+
position: absolute;
189+
height: calc(var(--nav-line-height) * 1em);
190+
width: calc(var(--nav-line-height) * 1em);
191+
margin-top: -0.05em;
192+
margin-left: calc(var(--nav-line-height) * -1em);
193+
} */
194+
195+
/* .nav-item.is-active > .nav-item-toggle {
196+
transform: rotate(90deg);
197+
} */
198+
199+
/*** nav-panel-explore styles, keeping for now as we might implement it elsewhere ***/
200+
213201
/* .nav-panel-explore {
214202
background: var(--nav-background);
215203
display: flex;
@@ -315,7 +303,3 @@ li[data-depth="1"] > .nav-text {
315303
opacity: 0.9;
316304
font-weight: var(--body-font-weight-bold);
317305
} */
318-
319-
/* .nav-link {
320-
padding: 1rem 0;
321-
} */

src/partials/nav-menu.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{{#with page.navigation}}
22
<div class="nav-panel-menu is-active" data-panel="menu">
33
<nav class="nav-menu">
4+
{{!-- {{#with @root.page.componentVersion}} --}}
5+
{{!-- <h3 class="title"><a href="{{{relativize ./url}}}">{{./title}}</a></h3> --}}
6+
{{!-- {{/with}} --}}
47
{{> nav-tree navigation=this}}
58
</nav>
69
</div>
7-
{{/with}}
10+
{{/with}}

src/partials/nav-tree.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
{{#each navigation}}
44
<li class="nav-item{{#if (eq ./url @root.page.url)}} is-current-page{{/if}}" data-depth="{{or ../level 0}}">
55
{{#if ./content}}
6-
{{#if ./items.length}}
7-
<button class="nav-item-toggle"></button>
8-
{{/if}}
6+
{{!-- {{#if ./items.length}} --}}
7+
{{!-- <button class="nav-item-toggle"></button> --}}
8+
{{!-- {{/if}} --}}
99
{{#if ./url}}
1010
<a class="nav-link" href="
1111
{{~#if (eq ./urlType 'internal')}}{{{relativize ./url}}}

0 commit comments

Comments
 (0)