Skip to content

Commit 01dbe9f

Browse files
authored
Merge pull request #9 from rakeshAlgo/nav-menu-ui
Nav menu Styling Completed
2 parents 5f4f2cd + 6063a37 commit 01dbe9f

File tree

10 files changed

+148
-63
lines changed

10 files changed

+148
-63
lines changed

src/css/component-frame.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
.component-frame {
22
/* rgba(87, 160, 255, 1) */
3-
/* background: rgba(var(--color-blue-rgb), 0.07); */
3+
background: var(--color-brand-gray6);
44
padding: 12px 30px 12px 15px;
55
display: flex;
66
align-items: center;
7+
justify-content: center;
78
}
89

910
.frame-body {
@@ -13,7 +14,8 @@
1314

1415
.frame-body .title {
1516
margin: 0;
16-
font-size: 1.25rem;
17+
font-size: 1.125rem;
18+
line-height: 1.5rem;
1719
font-weight: var(--weight-semibold);
1820
color: var(--color-brand-gray1);
1921
}

src/css/contributor.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.contributor-list-box {
2-
display: flex;
2+
/* display: flex; */
33
align-items: center;
44
flex-wrap: wrap;
55
margin: 15px 0 0;

src/css/doc.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,16 @@
142142
.doc caption {
143143
font-size: 1rem;
144144
font-weight: var(--weight-semibold);
145-
letter-spacing: -0.025em;
145+
/* letter-spacing: -0.025em; */
146146
line-height: 1.2;
147147
margin-bottom: 0.75rem;
148148
color: var(--color-brand-gray3);
149149
}
150150

151+
.ulist div.title {
152+
margin-left: -10px;
153+
}
154+
151155
.doc hr {
152156
margin: 1rem 0;
153157
border: 0 solid var(--color-border);

src/css/main.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ main p {
133133

134134
.article-header {
135135
margin-bottom: 0;
136+
margin-top: var(--base-space);
136137
align-items: flex-start;
137138
}
138139
}

src/css/nav.css

Lines changed: 116 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
background-color: var(--color-brand-gray7);
33
position: fixed;
44
width: inherit;
5-
overflow-y: scroll;
5+
overflow-y: auto;
66
font-size: 1rem;
77
line-height: 24px;
88
}
@@ -23,6 +23,8 @@
2323
margin-bottom: 1.5rem;
2424
height: var(--height-nav);
2525
z-index: var(--z-index-nav);
26+
border-left: 2px solid #eee;
27+
border-right: 2px solid #eee;
2628
}
2729
}
2830

@@ -43,18 +45,21 @@
4345
display: flex;
4446
word-break: break-all;
4547
align-items: center;
48+
font-size: 20px;
49+
line-height: 28px;
50+
font-family: "Open Sans", sans-serif;
51+
color: var(--color-brand-gray1);
52+
font-weight: var(--weight-semibold);
4653
}
4754

4855
.nav-line .fas {
4956
color: var(--color-brand-gray3);
50-
}
51-
52-
.nav-item.is-active .nav-line[data-depth="0"] .fas {
53-
color: var(--color-brand-blue);
57+
display: none;
5458
}
5559

5660
.nav-menu .nav-text {
57-
margin-left: 0.75rem;
61+
/* margin-left: 0.75rem; */
62+
margin-left: 0;
5863
}
5964

6065
.nav-menu a.nav-link {
@@ -73,6 +78,27 @@
7378
padding: 0;
7479
}
7580

81+
.nav-menu .nav-list .nav-list .nav-line {
82+
padding-left: 1.65rem;
83+
}
84+
85+
.nav-menu .nav-list .nav-list .nav-line[data-depth="2"] {
86+
padding-left: 3rem;
87+
}
88+
89+
.nav-menu .nav-list .nav-list .nav-line[data-depth="3"] {
90+
padding-left: 4.2rem;
91+
}
92+
93+
.nav-menu .nav-list .nav-list .nav-line[data-depth="4"] {
94+
padding-left: 5.5rem;
95+
}
96+
97+
.nav-menu .nav-list li a {
98+
font-size: 0.875rem;
99+
font-weight: var(--weight-normal);
100+
}
101+
76102
.nav-menu > .nav-list {
77103
/* margin: 1rem 1.875rem; */
78104
margin: 1.5rem 0;
@@ -84,8 +110,8 @@
84110
margin-bottom: 0.625rem;
85111
*/
86112
margin-bottom: 0.75rem;
87-
margin-left: 3.6875rem;
88-
border-left: 1px solid var(--color-brand-gray5);
113+
/* margin-left: 1rem; */
114+
/* border-left: 1px solid var(--color-brand-gray5); */
89115
}
90116

91117
/* .nav-menu .nav-item.is-active.is-active-depth-2[data-depth='0'] > .nav-list {
@@ -123,25 +149,53 @@
123149
} */
124150

125151
.nav-line[data-depth="0"] {
126-
padding: 0.625rem 1.875rem;
152+
padding: 0.625rem 1.25rem;
127153
color: var(--brand-color-gray2);
128154
}
129155

130-
.nav-item.is-active .nav-line[data-depth="0"] {
131-
background: rgba(var(--color-gray-rgb), 0.06);
156+
/* .nav-item.is-active .nav-line[data-depth="0"] {
157+
background: #4287D60F;
158+
margin-bottom: 0.625rem;
159+
border-right: 4px solid rgba(66, 135, 214, 0.44);
160+
} */
161+
162+
/* .nav-item.is-active > .nav-line[data-depth="0"], */
163+
.nav-item.open > .nav-line[data-depth="0"],
164+
.nav-item.is-current-path.is-active-depth-2:not(.is-active) > .nav-line,
165+
.nav-item.is-current-page > .nav-line {
166+
background: #4287d60f;
132167
margin-bottom: 0.625rem;
168+
border-right: 4px solid rgba(66, 135, 214, 0.44);
133169
}
134170

135171
.nav-item.is-active .nav-line[data-depth="0"] .nav-text {
136-
color: var(--color-brand-blue);
172+
/* color: var(--color-brand-blue); */
137173
font-weight: var(--weight-semibold);
138174
}
139175

176+
.nav-item.is-active .nav-line[data-depth="0"] .fas {
177+
color: var(--color-brand-blue);
178+
}
179+
140180
.nav-menu .nav-item.is-current-page > .nav-line > a.nav-link {
141181
color: var(--color-text);
142182
font-weight: var(--weight-medium);
143183
}
144184

185+
.nav-item.is-current-path.is-active[data-depth='1'] .in-toggle[data-depth='1'],
186+
.nav-item.is-current-page.is-active[data-depth='1'] .in-toggle[data-depth='1'],
187+
.nav-item.is-current-path.is-active[data-depth='2'] .in-toggle[data-depth='2'],
188+
.nav-item.is-current-page.is-active[data-depth='2'] .in-toggle[data-depth='2'],
189+
.nav-item.is-current-path.is-active[data-depth='3'] .in-toggle[data-depth='3'],
190+
.nav-item.is-current-page.is-active[data-depth='3'] .in-toggle[data-depth='3'] {
191+
transform: rotate(90deg);
192+
}
193+
194+
.nav-menu .nav-item.is-active[data-depth='2'] > .nav-line .nav-link {
195+
/* color: var(--color-brand-blue); */
196+
font-weight: var(--weight-semibold);
197+
}
198+
145199
.nav-menu .nav-toggle {
146200
background: none;
147201
border: 0;
@@ -190,24 +244,29 @@ html.is-clipped--nav {
190244
}
191245

192246
.main-nav-parent {
193-
font-size: 16px;
247+
font-size: var(--font-small);
194248
line-height: 20px;
195-
color: var(--color-brand-gray2);
249+
color: var(--color-brand-blue);
196250
display: flex;
197-
margin: 10px 0;
251+
margin: 15px 0 -20px;
198252
text-decoration: none;
199253
align-items: center;
200254
flex-wrap: wrap;
201-
background: rgba(var(--color-blue-rgb), 0.06);
255+
/* background: rgba(var(--color-blue-rgb), 0.06);
202256
padding: 10px 0;
203257
border-top: 1px solid var(--color-brand-gray5);
204-
border-bottom: 2px solid var(--color-brand-gray5);
258+
border-bottom: 2px solid var(--color-brand-gray5); */
205259
}
206260

207261
.main-nav-parent .back-to-menu {
208-
padding: 0 40px;
262+
padding: 0 22px;
209263
width: 100%;
210-
background: url(../img/back-arrow.png) no-repeat 20px center;
264+
/* background: url(../img/back-arrow.png) no-repeat 20px center; */
265+
cursor: pointer;
266+
}
267+
268+
.main-nav-parent .back-to-menu .fas {
269+
margin-right: 8px;
211270
}
212271

213272
.main-nav-parent .nav-text {
@@ -224,7 +283,7 @@ html.is-clipped--nav {
224283
}
225284

226285
.in-toggle {
227-
display: none;
286+
/* display: none; */
228287
cursor: pointer;
229288
/* margin-right: 10px; */
230289
}
@@ -233,16 +292,19 @@ html.is-clipped--nav {
233292
display: none;
234293
}
235294

236-
.nav-line[data-depth="1"],
237-
.nav-line[data-depth="2"] {
295+
.nav-menu .nav-item .nav-line {
238296
display: flex;
239-
justify-content: flex-end;
240-
padding: 0.625rem 1rem;
241-
flex-direction: row-reverse;
297+
/* justify-content: flex-end; */
298+
padding: 0.625rem 1.375rem;
299+
/* flex-direction: row-reverse; */
242300
}
243301

244302
.nav-line[data-depth="1"] .nav-link {
245-
color: var(--color-brand-gray4);
303+
/* color: var(--color-brand-gray4); */
304+
color: var(--color-brand-black);
305+
font-size: var(--font-base);
306+
line-height: var(--line-height-base);
307+
font-weight: var(--weight-semibold);
246308
}
247309

248310
.is-active[data-depth='0'] .is-active > .nav-line[data-depth="1"] {
@@ -258,12 +320,13 @@ html.is-clipped--nav {
258320
transform: rotate(90deg);
259321
} */
260322

261-
.nav-menu .nav-item.is-active[data-depth='1'] .nav-list {
323+
/* .nav-menu .nav-item.is-active[data-depth='1'] .nav-list {
262324
margin-left: 1.5rem;
263-
}
325+
} */
264326

265327
.nav-menu .nav-item[data-depth='2'] {
266-
margin: 0 8px 8px 0;
328+
/* margin: 0px 0px 8px 0px; */
329+
margin-bottom: 8px;
267330
}
268331

269332
.nav-menu .nav-item.is-active[data-depth='1'] > .nav-line .nav-link {
@@ -274,18 +337,31 @@ html.is-clipped--nav {
274337
color: var(--color-brand-gray1);
275338
}
276339

277-
.nav-menu .nav-item.is-active[data-depth='2'] > .nav-line .nav-link {
278-
color: var(--color-brand-blue);
279-
font-weight: 900;
280-
}
281-
282340
.nav-item[data-depth='1'] .in-toggle {
283-
background: url(../img/back-arrow.png) no-repeat center center;
284-
transform: rotate(180deg);
285-
width: 20px;
286-
height: 20px;
287-
margin-left: 5px;
288-
}
341+
position: relative;
342+
/* left: -5px; */
343+
width: 0;
344+
height: 0;
345+
margin-right: 10px;
346+
border-top: 6px solid transparent;
347+
border-bottom: 6px solid transparent;
348+
border-left: 10px solid var(--color-brand-gray5);
349+
}
350+
351+
/* .nav-item[data-depth='1'] .in-toggle::after {
352+
width: 0;
353+
height: 0;
354+
border-left: 4px solid transparent;
355+
border-right: 4px solid transparent;
356+
border-top: 8px solid red;
357+
top: 0;
358+
position: absolute;
359+
content: '';
360+
cursor: pointer;
361+
right: -15px;
362+
bottom: 0;
363+
margin: auto;
364+
} */
289365

290366
@media screen and (min-width: 769px) {
291367
.nav-control {

src/css/table.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,13 @@ table.table-tutorial tr td:last-child {
118118
/* margin-top: 2.5rem; */
119119
}
120120

121-
table.tableblock .title {
121+
table.tableblock caption.title {
122122
position: absolute;
123123
left: 0;
124124
top: -30px;
125125
}
126126

127+
div + table.tableblock,
127128
div.paragraph + table.tableblock,
128129
div.ulist + table.tableblock,
129130
table.tableblock + table.tableblock {

src/css/vars.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
--hljs-string: #295d1e;
6565
--hljs-number: #0711ba;
6666
/* --height-navbar: 4rem; */
67-
--height-spacer: 1.3rem;
68-
--height-navbar: 6.09rem;
67+
--height-spacer: 1rem;
68+
--height-navbar: 6rem;
6969
--height-to-body: calc(var(--height-navbar) + var(--height-spacer));
7070
--height-min-body: calc(100vh - var(--height-to-body));
7171
--height-nav: calc(var(--height-min-body) + var(--height-spacer));
@@ -97,6 +97,7 @@
9797
/* New design font style */
9898

9999
--font-base: 1rem; /* ~16px */
100+
--font-small: 0.875rem; /* ~14px */
100101
--labels-font-size: 0.75rem; /* ~12px */
101102
--labels-line-height: 1;
102103

src/js/01-nav.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
otherNavs[i].classList.add('is-inactive')
9898
}
9999
}
100+
this.classList.toggle('open')
100101
this.classList.toggle('is-active')
101102
}
102103

@@ -140,6 +141,8 @@
140141
return el
141142
}
142143

144+
// has children in li
145+
// $('ul.nav-list li.nav-item ul.nav-list .nav-item').has('ul.nav-list').addClass('has-children')
143146
function concealEvent (e) {
144147
e.stopPropagation()
145148
}

0 commit comments

Comments
 (0)