Skip to content

Commit fc55776

Browse files
committed
wip: sidebar
1 parent b3305e9 commit fc55776

File tree

7 files changed

+63
-29
lines changed

7 files changed

+63
-29
lines changed

.eslintrc.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"extends": "airbnb-base"
3-
}
2+
"extends": "airbnb-base",
3+
"env": {
4+
"browser": true,
5+
"node": true
6+
}
7+
}

assets/sprite.svg

+1-5
Loading

js/sidebar.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
const sidebarItems = document.querySelectorAll('.navigation__item');
2+
const sidebarMenus = [...sidebarItems].filter(item => item.contains(item.querySelector('.navigation__list')));
23

3-
console.log([...sidebarItems].filter(item => {
4-
return item.contains(item.querySelector('.navigation__list'))
5-
}));
4+
const toggleMenu = (event) => {
5+
event.preventDefault();
6+
console.log('test');
7+
};
8+
9+
sidebarMenus.forEach((menu) => {
10+
const caret = menu.querySelector('svg');
11+
caret.addEventListener('click', toggleMenu);
12+
});

layouts/partials/sidebar.pug

+26-12
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,46 @@ section(class='sidebar')
99
li(class='navigation__item')
1010
a(href='/')
1111
svg(class='navigation__icon')
12-
use(xlink:href='assets/sprite.svg#chevron-right')
12+
use(xlink:href='assets/sprite.svg#chevron')
1313
| Release Notes
14-
ul(class='navigation__list')
15-
li(class='navigation__item navigation__item--active') dcos
16-
li(class='navigation__item') dcos auth
17-
li(class='navigation__item') dcos config
18-
li(class='navigation__item') dcos experimental
19-
li(class='navigation__item') dcos help
2014
li(class='navigation__item')
2115
a(href='/')
2216
svg(class='navigation__icon')
23-
use(xlink:href="assets/sprite.svg#chevron-right")
17+
use(xlink:href="assets/sprite.svg#chevron")
2418
| Overview
2519
li(class='navigation__item')
2620
a(href='/')
2721
svg(class='navigation__icon')
28-
use(xlink:href="assets/sprite.svg#chevron-right")
22+
use(xlink:href="assets/sprite.svg#chevron")
2923
| Installing & Upgrading
3024
li(class='navigation__item')
3125
a(href='/')
3226
svg(class='navigation__icon')
33-
use(xlink:href="assets/sprite.svg#chevron-right")
27+
use(xlink:href="assets/sprite.svg#chevron")
3428
| GUI
35-
li(class='navigation__item')
29+
li(class='navigation__item navigation__item--active')
3630
a(href='/')
3731
svg(class='navigation__icon')
38-
use(xlink:href="assets/sprite.svg#chevron-right")
32+
use(xlink:href="assets/sprite.svg#chevron")
3933
| CLI
34+
ol(class='navigation__list')
35+
li(class='navigation__item')
36+
a(href='/') Installing the CLI
37+
li(class='navigation__item')
38+
a(href='/') Configuring the CLI
39+
li(class='navigation__item')
40+
a(href='/') Updating the CLI
41+
li(class='navigation__item')
42+
a(href='/') Uninstalling the CLI
43+
li(class='navigation__item')
44+
a(href='/')
45+
svg(class='navigation__icon')
46+
use(xlink:href="assets/sprite.svg#chevron")
47+
| Command Reference
48+
ol(class='navigation__list')
49+
li(class='navigation__item navigation__item--active') dcos
50+
li(class='navigation__item') dcos auth
51+
li(class='navigation__item') dcos config
52+
li(class='navigation__item') dcos experimental
53+
li(class='navigation__item') dcos help
4054
//- li(class='navigation__item navigation__item--selected') Uninstalling the CLI

scss/base/_layout.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@include md {
1414
flex-direction: row;
1515
&__sidebar {
16-
width: 300px;
16+
width: 350px;
1717
display: flex;
1818
flex-direction: column;
1919
}

scss/components/_sidebar.scss

+17-5
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,39 @@
1111
}
1212

1313
.navigation {
14-
padding: 1rem;
14+
padding: 2rem;
1515
&__list {
1616
list-style-type: none;
1717
margin: 0;
1818
padding: 0;
1919
}
2020
color: rgba(255, 255, 255, 0.6);
2121
&__item {
22-
line-height: 1.7;
22+
position: relative;
23+
line-height: 1.8;
2324
a {
24-
display: flex;
25-
align-items: center;
2625
color: rgba(255, 255, 255, 0.6);
2726
// color: $color-light;
2827
text-decoration: none;
2928
}
29+
&--active {
30+
svg {
31+
transform: rotate(90deg);
32+
}
33+
}
3034
}
3135
&__icon {
36+
position: absolute;
3237
width: 16px;
3338
height: 16px;
34-
margin-right: 5px;
39+
top: 5px;
40+
left: -20px;
3541
color: rgba(255, 255, 255, 0.6);
3642
}
43+
& ol li {
44+
margin-left: 1rem;
45+
& li {
46+
margin-left: 1rem;
47+
}
48+
}
3749
}

scss/vendor/_typebase.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/*! Typebase.scss v0.1.0 | MIT License */
22

3+
// TODO Needs media queries?
34
// Typesetting variables. Edit these!
4-
$baseFontSize:16; // in pixels. This would result in 22px on desktop
5+
$baseFontSize:14; // in pixels. This would result in 22px on desktop
56
$baseLineHeight:1.5; // how large the line height is as a multiple of font size
67
$leading:$baseLineHeight * 1rem;
78
// Rate of growth for headings

0 commit comments

Comments
 (0)