Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
feat(documentation): Style new sidebar menu items, style new mobile s…
Browse files Browse the repository at this point in the history
…elect menu and a few svg fixes
  • Loading branch information
LukyVj committed Apr 7, 2016
1 parent e4c4a0b commit 71664cd
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 43 deletions.
4 changes: 3 additions & 1 deletion docs/source/javascripts/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export default function sidebar({headersContainer, sidebarContainer, headerStart
const select = document.createElement('select');
const list = document.createElement('ul');
const startLevel = headerStartLevel; // we start at h2
list.classList.add('no-mobile');
let currentList = list;
let currentLevel = startLevel;

Expand All @@ -29,6 +30,7 @@ export default function sidebar({headersContainer, sidebarContainer, headerStart
const option = document.createElement('option');
option.setAttribute('value', link.getAttribute('href'));
option.textContent = `${spacer(currentLevel - startLevel)}${title}`;
select.classList.add('display-on-small');
select.appendChild(option);
});

Expand Down Expand Up @@ -65,7 +67,7 @@ function sidebarFollowScroll(sidebarContainer) {
// On the documentation sidebar depending on the
// clicked item
function activeLinks(sidebarContainer) {
const linksContainer = sidebarContainer.querySelector('ul');
const linksContainer = sidebarContainer.querySelector('ul li');

linksContainer.addEventListener('click', function(e) {
if (e.target.tagName === 'A') {
Expand Down
26 changes: 24 additions & 2 deletions docs/source/stylesheets/components/_documentation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,28 @@
ul {
font-size: 16px;
line-height: 22px;

li {
clear: both;
}

ul {
font-weight: normal;
font-size: 14px;
position: relative;

li {
height: 26px;
line-height: 26px;

&:before {
content: '-';
float: left;
margin-right: 6px;
color: $greyish
}
}
}
}

h2 {
Expand Down Expand Up @@ -99,7 +121,7 @@
}

.algolia-places {
color: #000000
color: #000000;
}

h2, h3 {
Expand All @@ -125,7 +147,7 @@
}

@include small-mq {
padding-top: 16px;
padding-top: 32px;

.container {
.documentation-container {
Expand Down
44 changes: 9 additions & 35 deletions docs/source/stylesheets/components/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,52 +53,26 @@ nav.sidebar {
@include small-mq {
width: calc(100% + 16px);
max-width: calc(100% + 16px);
position: relative;
position: absolute;
max-height: 40px;
left: 0px;
top: -16px;
top: 16px;
border: none;
padding-top: 0;

ul {
width: 100%;
padding: 0 16px;
height: 40px;

li {
float: left;
display: inline-block;
width: auto;
height: 40px;
line-height: 40px;
margin-right: 8px;
display: none;


a {
text-align: center;
color: #fff;

&:focus,
&:target {
font-weight: bold;
box-shadow: none;
}
}

&.active a {
font-weight: bold;
box-shadow: none;
}
}
select {
width: calc(100% - 32px);
margin: 8px 8px;
visibility: hidden;
}

&.fixed {
background: $brand-primary;
color: #fff;
top: $navigation-height;

ul li {
display: inline-block;
select {
visibility: visible;
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions docs/source/stylesheets/vendors/_svg-animations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ $timingFunction: 3s ease infinite;
}
}

svg {
display: block;
width: 100%;
}

#pin {
animation: bounce $timingFunction;
}
Expand Down
6 changes: 6 additions & 0 deletions src/places.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,14 @@
bottom: 0;
right: 12px;
outline: none;

svg {
fill: #cfcfcf;
// keep the icons centered
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
}
}

Expand Down

0 comments on commit 71664cd

Please sign in to comment.