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

Commit

Permalink
fix(documentation): Different styles tweaks to fit to #54
Browse files Browse the repository at this point in the history
  • Loading branch information
LukyVj committed Apr 6, 2016
1 parent 32edb43 commit dc14334
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 5 deletions.
21 changes: 21 additions & 0 deletions docs/source/javascripts/documentation.js
Expand Up @@ -5,6 +5,7 @@ import './responsive-navigation.js';
demo();
anchorableTitles();
sidebarFollowScroll();
//activeLinks();

function demo() {
places({
Expand Down Expand Up @@ -51,3 +52,23 @@ function sidebarFollowScroll() {
}
});
}

// The Following code is used to set active items
// On the documentation sidebar depending on the
// clicked item

let linksContainer = document.querySelector('#sidebar ul');
let removeActive = (item) => {
item.classList.remove('active');
};

linksContainer.addEventListener('click', function(e) {

// UGLY AS F**K
if (e.target.tagName === 'A') {
[].forEach.call(this.children, removeActive);
e.target.parentNode.classList.add('active');
}
});


2 changes: 1 addition & 1 deletion docs/source/partials/documentation/sidebar.md
@@ -1,3 +1,3 @@
- [Getting started](#getting-started)
- [API](#api)
- [Rate limit](#rate-limitf)
- [Rate limit](#rate-limit)
2 changes: 1 addition & 1 deletion docs/source/stylesheets/components/_containers.scss
Expand Up @@ -107,7 +107,7 @@ section {
min-height: 314px
}

svg {
.fl-right svg {
path,
ellipse {
transform: translateY(12px);
Expand Down
10 changes: 9 additions & 1 deletion docs/source/stylesheets/components/_documentation.scss
Expand Up @@ -43,14 +43,22 @@
}

h2, h3 {
padding-bottom: 8px;

.anchor {
color: $red-pink;
text-decoration: none;
}
&:hover {
.anchor {
display: inline;
}
}

&:target {
text-decoration: underline;
.anchor {
display: inline;
}
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions docs/source/stylesheets/components/_sidebar.scss
Expand Up @@ -38,10 +38,13 @@ nav.sidebar {

&:focus,
&:target {
color: $red-pink;
box-shadow: inset -2px 0 0 0 $red-pink
@extend %active-links;
}
}

&.active a{
@extend %active-links;
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions docs/source/stylesheets/vendors/_mixins.scss
Expand Up @@ -18,6 +18,11 @@
float: none;
}

%active-links {
color: $red-pink;
box-shadow: inset -2px 0 0 0 $red-pink
}

@mixin big-min-mq {
@media (min-width: $bp-big){
@content
Expand Down

0 comments on commit dc14334

Please sign in to comment.