hacks-guide-minimal-mistake.../assets/_scss/_navigation.scss

308 lines
5.1 KiB
SCSS
Raw Normal View History

2016-03-10 19:06:59 +01:00
/* ==========================================================================
NAVIGATION
========================================================================== */
/*
Breadcrumb navigation links
========================================================================== */
.breadcrumbs {
@include container;
@include clearfix;
2016-03-23 16:42:58 +01:00
margin-top: 0;
margin-bottom: 0;
padding-left: 2em;
padding-right: 2em;
font-family: $sans-serif;
2016-03-21 21:36:24 +01:00
2016-03-23 16:06:58 +01:00
@include breakpoint($large) {
padding-left: 1em;
padding-right: 1em;
}
@include breakpoint($x-large) {
max-width: $x-large;
}
2016-03-10 19:06:59 +01:00
ol {
padding: 0;
list-style: none;
font-size: 14px;
2016-03-21 21:36:24 +01:00
2016-03-23 16:06:58 +01:00
@include breakpoint($large) {
@include span(10 of 12 last);
}
@include breakpoint($x-large) {
@include prefix(0.5 of 12);
}
2016-03-10 19:06:59 +01:00
}
2016-03-21 21:36:24 +01:00
2016-03-10 19:06:59 +01:00
li {
display: inline;
}
2016-03-21 21:36:24 +01:00
2016-03-10 19:06:59 +01:00
.current {
font-weight: bold;
}
}
/*
Post pagination navigation links
========================================================================== */
.pagination {
margin-top: 1em;
padding-top: 1em;
2016-03-10 19:06:59 +01:00
border-top: 1px solid $border-color;
2016-03-21 21:36:24 +01:00
2016-03-10 19:06:59 +01:00
ul {
margin: 0;
padding: 0;
list-style-type: none;
font-family: $sans-serif;
font-size: 12px;
2016-03-10 19:06:59 +01:00
}
2016-03-21 21:36:24 +01:00
2016-03-10 19:06:59 +01:00
li {
display: inline-block;
}
2016-03-21 21:36:24 +01:00
2016-03-10 19:06:59 +01:00
li + li:before {
content: "";
padding-right: 10px;
}
2016-03-21 21:36:24 +01:00
2016-03-10 19:06:59 +01:00
.current {
font-weight: bold;
}
}
/*
Priority plus navigation
========================================================================== */
.greedy-nav {
position: relative;
min-width: 250px;
background: #fff;
a {
display: block;
2016-03-23 03:59:39 +01:00
margin: 0 20px;
padding: 10px 0;
color: $gray;
text-decoration: none;
2016-03-23 03:59:39 +01:00
&:hover {
color: #000;
}
}
button {
position: absolute;
height: 100%;
right: 0;
padding: 0 10px;
border: 0;
outline: none;
background-color: #000;
color: #fff;
cursor: pointer;
}
.visible-links {
display: inline-table;
li {
display: table-cell;
&:first-child {
font-weight: bold;
2016-03-23 03:59:39 +01:00
a {
2016-03-23 03:59:39 +01:00
margin-left: 0;
}
}
&:last-child {
a {
2016-03-23 03:59:39 +01:00
margin-right: 0;
}
}
}
2016-03-23 03:59:39 +01:00
a {
2016-03-24 20:46:06 +01:00
position: relative;
&:before {
content: "";
position: absolute;
bottom: 0;
height: 4px;
background: $light-gray;
width: 0;
transition: 0.3s;
}
2016-03-23 03:59:39 +01:00
&:hover {
color: #000;
border-bottom-color: $border-color;
2016-03-24 20:46:06 +01:00
&:before {
width: 100%;
}
2016-03-23 03:59:39 +01:00
}
}
}
.hidden-links {
position: absolute;
top: 100%;
right: 0;
margin-top: 15px;
padding: 5px;
border: 1px solid $border-color;
border-radius: $border-radius;
background: #fff;
box-shadow: 0 0 10px rgba(#000, 0.25);
a {
2016-03-23 03:59:39 +01:00
margin: 0;
padding: 10px 20px;
font-size: 0.8em;
2016-03-23 03:59:39 +01:00
&:hover {
color: #000;
background: $border-color;
}
}
&:before {
content: "";
position: absolute;
top: -11px;
right: 10px;
width: 0;
border-style: solid;
border-width: 0 10px 10px;
border-color: $border-color transparent;
display: block;
z-index: 0;
}
&:after {
content: "";
position: absolute;
top: -10px;
right: 10px;
width: 0;
border-style: solid;
border-width: 0 10px 10px;
border-color: #fff transparent;
display: block;
z-index: 1;
}
li {
display: block;
border-bottom: 1px solid $border-color;
2016-03-23 03:59:39 +01:00
&:last-child {
border-bottom: none;
}
}
}
}
/*
Navigation list
========================================================================== */
.nav__list {
a {
display: block;
padding: 4px 0;
&:hover {
text-decoration: underline;
}
}
.active {
color: $primary-color;
font-weight: bold;
}
}
.nav__title {
margin: 0;
padding: 10px 20px;
font-family: $sans-serif-narrow;
font-size: 16px;
font-weight: bold;
border-bottom: 1px solid $border-color;
}
.nav__sub-title {
display: block;
margin: 10px 0;
padding: 10px 0;
font-family: $sans-serif-narrow;
2016-03-26 01:57:52 +01:00
font-size: 16px;
font-weight: bold;
border-bottom: 1px solid $border-color;
}
/*
Table of contents navigation
========================================================================== */
.toc {
font-family: $sans-serif-narrow;
color: $gray;
text-transform: uppercase;
letter-spacing: 1px;
background-color: #fff;
border: 1px solid $border-color;
border-radius: $border-radius;
}
.toc__menu {
margin: 0;
padding: 0;
width: 100%;
list-style: none;
a {
display: block;
padding: 10px 20px;
color: $gray;
font-size: 11px;
font-weight: bold;
line-height: 1.5;
border-bottom: 1px solid $border-color;
&:hover {
color: #000;
background: $lighter-gray;
}
}
li ul > li a {
font-weight: normal;
}
// hide sub sub links on small screens
li > ul li {
display: none;
@include breakpoint($medium) {
display: block;
}
}
2016-03-10 19:06:59 +01:00
}