Skip to content

Commit 54e4472

Browse files
committed
Adds two levels navigation (doc)
1 parent cfb5f9a commit 54e4472

File tree

3 files changed

+43
-12
lines changed

3 files changed

+43
-12
lines changed

assets/scss/docs.scss

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,30 @@ body {
7575
// DOCS NAV
7676
//---------
7777
.docs-nav {
78-
padding: $space-small 0;
78+
padding: ($v-unit * 2) 0;
7979

8080
// &__list {}
8181

8282
// &__item {}
8383

84+
&__items {
85+
padding: $v-unit 0;
86+
}
87+
88+
&__section-title {
89+
border-bottom: 1px solid rgba(neutral-color('medium'), 0.5);
90+
margin: 0;
91+
padding: $v-unit $h-unit;
92+
}
93+
8494
&__link {
8595
@include get-type('h6');
86-
border: 0;
96+
border-bottom: 0;
8797
color: neutral-color('medium');
8898
display: block;
8999
font-weight: normal;
90100
margin: 0;
91-
padding: ($space-base / 2) $space-base;
101+
padding: ($v-unit / 2) $h-unit;
92102
text-transform: uppercase;
93103
}
94104
}

settings/pug.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
var data = require('./../dist/data.json');
22
data.navigation = [
3-
{label: 'Logo', url: '#logo'},
4-
{label: 'Palettes', url: '#palettes'},
5-
{label: 'Typography', url: '#typography'},
6-
{label: 'Icons', url: '#icons'},
7-
{label: 'Faq', url: '#faq'},
8-
{label: 'Footer', url: '#footer'}
3+
{
4+
label: 'Basic',
5+
items: [
6+
{label: 'Logo', url: '#logo'},
7+
{label: 'Palettes', url: '#palettes'},
8+
{label: 'Typography', url: '#typography'},
9+
{label: 'Icons', url: '#icons'}
10+
]
11+
},
12+
{
13+
label: 'Components',
14+
items: [
15+
{label: 'Faq', url: '#faq'}
16+
]
17+
},
18+
{
19+
label: 'Layouts',
20+
items: [
21+
{label: 'Header', url: '#header'},
22+
{label: 'Footer', url: '#footer'}
23+
]
24+
}
925
];
1026
data.palettes = require('./palettes');
1127
data.typography = require('./typography');

views/docs/_layout.pug

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,17 @@ html
2525
.docs-logo
2626
.docs-logo__image
2727
include ../../assets/images/logo/vertical.svg
28+
2829
nav.docs-nav
2930
.docs-nav__list
3031
each item in navigation
31-
li.docs-nav__item
32-
a.docs-nav__link(
33-
href=`/docs.html?${item.url}`)!=item.label
32+
.docs-nav__item
33+
h6.docs-nav__section-title!=item.label
34+
.docs-nav__items
35+
each subItem in item.items
36+
a.docs-nav__link(
37+
href=`/docs.html?${subItem.url}`)!=subItem.label
38+
3439
.docs-layout__page-wrapper
3540
.docs-layout__page
3641
block page

0 commit comments

Comments
 (0)