Ghost theme (MIT license)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

738 lines
21 KiB

10 years ago
// Foundation by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
10 years ago
@import 'global';
@import 'grid';
@import 'buttons';
@import 'forms';
10 years ago
//
// Top Bar Variables
//
$include-html-top-bar-classes: $include-html-classes !default;
// Background color for the top bar
$topbar-bg-color: $oil !default;
$topbar-bg: $topbar-bg-color !default;
// Height and margin
10 years ago
$topbar-height: rem-calc(45) !default;
10 years ago
$topbar-margin-bottom: 0 !default;
// Controlling the styles for the title in the top bar
$topbar-title-weight: $font-weight-normal !default;
$topbar-title-font-size: rem-calc(17) !default;
// Set the link colors and styles for top-level nav
$topbar-link-color: $white !default;
$topbar-link-color-hover: $white !default;
$topbar-link-color-active: $white !default;
$topbar-link-color-active-hover: $white !default;
$topbar-link-weight: $font-weight-normal !default;
$topbar-link-font-size: rem-calc(13) !default;
$topbar-link-hover-lightness: -10% !default; // Darken by 10%
$topbar-link-bg: $topbar-bg !default;
10 years ago
$topbar-link-bg-hover: $jet !default;
10 years ago
$topbar-link-bg-color-hover: $charcoal !default;
$topbar-link-bg-active: $primary-color !default;
$topbar-link-bg-active-hover: scale-color($primary-color, $lightness: -14%) !default;
$topbar-link-font-family: $body-font-family !default;
$topbar-link-text-transform: none !default;
10 years ago
$topbar-link-padding: ($topbar-height / 3) !default;
10 years ago
$topbar-back-link-size: rem-calc(18) !default;
10 years ago
$topbar-link-dropdown-padding: rem-calc(20) !default;
10 years ago
$topbar-button-font-size: .75rem !default;
10 years ago
$topbar-button-top: 7px !default;
// Style the top bar dropdown elements
$topbar-dropdown-bg: $oil !default;
$topbar-dropdown-link-color: $white !default;
$topbar-dropdown-link-color-hover: $topbar-link-color-hover !default;
$topbar-dropdown-link-bg: $oil !default;
10 years ago
$topbar-dropdown-link-bg-hover: $jet !default;
10 years ago
$topbar-dropdown-link-weight: $font-weight-normal !default;
$topbar-dropdown-toggle-size: 5px !default;
$topbar-dropdown-toggle-color: $white !default;
10 years ago
$topbar-dropdown-toggle-alpha: .4 !default;
10 years ago
$topbar-dropdown-label-color: $monsoon !default;
$topbar-dropdown-label-text-transform: uppercase !default;
$topbar-dropdown-label-font-weight: $font-weight-bold !default;
$topbar-dropdown-label-font-size: rem-calc(10) !default;
$topbar-dropdown-label-bg: $oil !default;
// Top menu icon styles
$topbar-menu-link-transform: uppercase !default;
$topbar-menu-link-font-size: rem-calc(13) !default;
$topbar-menu-link-weight: $font-weight-bold !default;
$topbar-menu-link-color: $white !default;
$topbar-menu-icon-color: $white !default;
$topbar-menu-link-color-toggled: $jumbo !default;
$topbar-menu-icon-color-toggled: $jumbo !default;
10 years ago
$topbar-menu-icon-position: $opposite-direction !default; // Change to $default-float for a left menu icon
10 years ago
// Transitions and breakpoint styles
$topbar-transition-speed: 300ms !default;
// Using rem-calc for the below breakpoint causes issues with top bar
$topbar-breakpoint: #{lower-bound($medium-range)} !default; // Change to 9999px for always mobile layout
10 years ago
$topbar-media-query: "#{$screen} and (min-width:#{lower-bound($topbar-breakpoint)})";
10 years ago
10 years ago
// Top-bar input styles
$topbar-input-height: rem-calc(28) !default;
10 years ago
// Divider Styles
$topbar-divider-border-bottom: solid 1px scale-color($topbar-bg-color, $lightness: 13%) !default;
$topbar-divider-border-top: solid 1px scale-color($topbar-bg-color, $lightness: -50%) !default;
// Sticky Class
$topbar-sticky-class: ".sticky" !default;
$topbar-arrows: true !default; //Set false to remove the triangle icon from the menu item
$topbar-dropdown-arrows: true !default; //Set false to remove the \00bb >> text from dropdown subnavigation li
// Accessibility mixins for hiding and showing the menu dropdown items
@mixin topbar-hide-dropdown {
// Makes an element visually hidden by default, but visible when focused.
@include element-invisible();
10 years ago
display: block;
10 years ago
}
@mixin topbar-show-dropdown {
@include element-invisible-off();
10 years ago
display: block;
10 years ago
position: absolute !important; // Reset the position from static to absolute
}
@include exports("top-bar") {
@if $include-html-top-bar-classes {
// Used to provide media query values for javascript components.
// This class is generated despite the value of $include-html-top-bar-classes
// to ensure width calculations work correctly.
meta.foundation-mq-topbar {
font-family: "/" + unquote($topbar-media-query) + "/";
width: $topbar-breakpoint;
}
/* Wrapped around .top-bar to contain to grid width */
.contain-to-grid {
width: 100%;
background: $topbar-bg;
10 years ago
.top-bar {
margin-bottom: $topbar-margin-bottom;
}
10 years ago
}
// Wrapped around .top-bar to make it stick to the top
.fixed {
position: fixed;
top: 0;
10 years ago
width: 100%;
10 years ago
z-index: 99;
10 years ago
#{$default-float}: 0;
10 years ago
&.expanded:not(.top-bar) {
10 years ago
height: auto;
max-height: 100%;
10 years ago
overflow-y: auto;
width: 100%;
10 years ago
.title-area {
position: fixed;
width: 100%;
z-index: 99;
}
10 years ago
10 years ago
// Ensure you can scroll the menu on small screens
.top-bar-section {
margin-top: $topbar-height;
10 years ago
z-index: 98;
10 years ago
}
}
}
.top-bar {
10 years ago
background: $topbar-bg;
10 years ago
height: $topbar-height;
line-height: $topbar-height;
margin-bottom: $topbar-margin-bottom;
10 years ago
overflow: hidden;
position: relative;
10 years ago
// Topbar Global list Styles
ul {
list-style: none;
10 years ago
margin-bottom: 0;
10 years ago
}
10 years ago
.row {
max-width: none;
}
10 years ago
form,
10 years ago
input,
select {
margin-bottom: 0;
}
10 years ago
10 years ago
input,
select {
font-size: $topbar-button-font-size;
height: $topbar-input-height;
padding-bottom: .35rem;
padding-top: .35rem;
10 years ago
}
10 years ago
.button, button {
font-size: $topbar-button-font-size;
10 years ago
margin-bottom: 0;
padding-bottom: .35rem + rem-calc(1);
padding-top: .35rem + rem-calc(1);
10 years ago
// position: relative;
// top: -1px;
10 years ago
// Corrects a slight misalignment when put next to an input field
@media #{$small-only} {
position: relative;
top: -1px;
}
}
// Title Area
.title-area {
margin: 0;
10 years ago
position: relative;
10 years ago
}
.name {
10 years ago
font-size: $rem-base;
10 years ago
height: $topbar-height;
margin: 0;
10 years ago
h1, h2, h3, h4, p, span {
10 years ago
font-size: $topbar-title-font-size;
10 years ago
line-height: $topbar-height;
10 years ago
margin: 0;
10 years ago
10 years ago
a {
color: $topbar-link-color;
display: block;
10 years ago
font-weight: $topbar-title-weight;
10 years ago
padding: 0 $topbar-link-padding;
10 years ago
width: 75%;
10 years ago
}
}
}
// Menu toggle button on small devices
.toggle-topbar {
position: absolute;
10 years ago
#{$topbar-menu-icon-position}: 0;
10 years ago
top: 0;
a {
color: $topbar-link-color;
10 years ago
display: block;
10 years ago
font-size: $topbar-menu-link-font-size;
font-weight: $topbar-menu-link-weight;
height: $topbar-height;
line-height: $topbar-height;
10 years ago
padding: 0 $topbar-link-padding;
position: relative;
text-transform: $topbar-menu-link-transform;
10 years ago
}
// Adding the class "menu-icon" will add the 3-line icon people love and adore.
&.menu-icon {
margin-top: -16px;
10 years ago
top: 50%;
10 years ago
a {
10 years ago
@include hamburger(16px, false, 0, 1px, 6px, $topbar-menu-icon-color, "", false);
10 years ago
@if $text-direction == rtl {
text-indent: -58px;
}
10 years ago
color: $topbar-menu-link-color;
10 years ago
height: 34px;
line-height: 33px;
10 years ago
padding: 0 $topbar-link-padding+rem-calc(25) 0 $topbar-link-padding;
10 years ago
position: relative;
}
}
}
// Change things up when the top-bar is expanded
&.expanded {
background: transparent;
10 years ago
height: auto;
10 years ago
10 years ago
.title-area {
background: $topbar-bg;
}
10 years ago
.toggle-topbar {
10 years ago
a {
color: $topbar-menu-link-color-toggled;
span::after {
10 years ago
// Shh, don't tell, but box-shadows create the menu icon :)
// Change the color of the bars when the menu is expanded, using given thickness from hamburger() above
10 years ago
box-shadow: 0 0 0 1px $topbar-menu-icon-color-toggled,
10 years ago
0 7px 0 1px $topbar-menu-icon-color-toggled,
0 14px 0 1px $topbar-menu-icon-color-toggled;
}
}
}
10 years ago
// Fixes an issue with Desktop and Mobile Safari where deeply-nested menus don't appear
@media screen and (-webkit-min-device-pixel-ratio:0) {
.top-bar-section {
.has-dropdown.moved > .dropdown,
.dropdown {
clip: initial;
}
// This was needed as parent ul's had padding, and the clip: was allowing content to peak through
.has-dropdown:not(.moved) > ul {
padding: 0;
}
}
}
10 years ago
}
}
// Right and Left Navigation that stacked by default
.top-bar-section {
#{$default-float}: 0;
position: relative;
width: auto;
@include single-transition($default-float, $topbar-transition-speed);
ul {
display: block;
font-size: $rem-base;
10 years ago
height: auto;
10 years ago
margin: 0;
10 years ago
padding: 0;
width: 100%;
10 years ago
}
.divider,
[role="separator"] {
border-top: $topbar-divider-border-top;
clear: both;
height: 1px;
width: 100%;
}
ul li {
background: $topbar-dropdown-bg;
10 years ago
> a {
10 years ago
color: $topbar-link-color;
10 years ago
display: block;
10 years ago
font-family: $topbar-link-font-family;
font-size: $topbar-link-font-size;
font-weight: $topbar-link-weight;
10 years ago
padding-#{$default-float}: $topbar-link-padding;
padding: 12px 0 12px $topbar-link-padding;
10 years ago
text-transform: $topbar-link-text-transform;
10 years ago
width: 100%;
10 years ago
&.button {
font-size: $topbar-link-font-size;
padding-#{$default-float}: $topbar-link-padding;
10 years ago
padding-#{$opposite-direction}: $topbar-link-padding;
10 years ago
@include button-style($bg:$primary-color);
}
10 years ago
10 years ago
&.button.secondary { @include button-style($bg:$secondary-color); }
&.button.success { @include button-style($bg:$success-color); }
&.button.alert { @include button-style($bg:$alert-color); }
&.button.warning { @include button-style($bg:$warning-color); }
10 years ago
&.button.info { @include button-style($bg:$info-color); }
10 years ago
}
> button {
font-size: $topbar-link-font-size;
padding-#{$default-float}: $topbar-link-padding;
10 years ago
padding-#{$opposite-direction}: $topbar-link-padding;
10 years ago
@include button-style($bg:$primary-color);
&.secondary { @include button-style($bg:$secondary-color); }
&.success { @include button-style($bg:$success-color); }
&.alert { @include button-style($bg:$alert-color); }
&.warning { @include button-style($bg:$warning-color); }
10 years ago
&.info { @include button-style($bg:$info-color); }
10 years ago
}
// Apply the hover link color when it has that class
&:hover:not(.has-form) > a {
background-color: $topbar-link-bg-color-hover;
10 years ago
color: $topbar-link-color-hover;
10 years ago
@if ($topbar-link-bg-hover) {
background: $topbar-link-bg-hover;
}
}
// Apply the active link color when it has that class
&.active > a {
background: $topbar-link-bg-active;
color: $topbar-link-color-active;
10 years ago
10 years ago
&:hover {
10 years ago
background: $topbar-link-bg-active-hover;
color: $topbar-link-color-active-hover;
10 years ago
}
}
}
// Add some extra padding for list items contains buttons
10 years ago
.has-form {
padding: $topbar-link-padding;
}
10 years ago
// Styling for list items that have a dropdown within them.
.has-dropdown {
position: relative;
10 years ago
> a {
10 years ago
&:after {
10 years ago
@if ($topbar-arrows) {
10 years ago
@include css-triangle($topbar-dropdown-toggle-size, rgba($topbar-dropdown-toggle-color, $topbar-dropdown-toggle-alpha), $default-float);
}
10 years ago
10 years ago
margin-#{$opposite-direction}: $topbar-link-padding;
margin-top: -($topbar-dropdown-toggle-size / 2) - 2;
position: absolute;
top: 50%;
#{$opposite-direction}: 0;
}
}
10 years ago
&.moved {
position: static;
> .dropdown {
10 years ago
@include topbar-show-dropdown();
width: 100%;
}
10 years ago
> a:after {
10 years ago
display: none;
}
}
}
// Styling elements inside of dropdowns
.dropdown {
10 years ago
@include topbar-hide-dropdown();
10 years ago
padding: 0;
position: absolute;
top: 0;
z-index: 99;
10 years ago
#{$default-float}: 100%;
10 years ago
li {
height: auto;
10 years ago
width: 100%;
10 years ago
a {
font-weight: $topbar-dropdown-link-weight;
padding: 8px $topbar-link-padding;
&.parent-link {
font-weight: $topbar-link-weight;
}
}
10 years ago
&.title h5,
&.parent-link {
10 years ago
// Back Button
margin-bottom: 0;
margin-top: 0;
font-size: $topbar-back-link-size;
a {
color: $topbar-link-color;
10 years ago
// line-height: ($topbar-height / 2);
10 years ago
display: block;
&:hover { background:none; }
}
}
10 years ago
&.has-form {
padding: 8px $topbar-link-padding;
}
.button,
button {
top: auto;
}
10 years ago
}
label {
color: $topbar-dropdown-label-color;
font-size: $topbar-dropdown-label-font-size;
10 years ago
font-weight: $topbar-dropdown-label-font-weight;
margin-bottom: 0;
padding: 8px $topbar-link-padding 2px;
text-transform: $topbar-dropdown-label-text-transform;
10 years ago
}
}
}
.js-generated { display: block; }
// Top Bar styles intended for screen sizes above the breakpoint.
@media #{$topbar-media-query} {
.top-bar {
@include clearfix;
10 years ago
background: $topbar-bg;
10 years ago
overflow: visible;
.toggle-topbar { display: none; }
.title-area { float: $default-float; }
10 years ago
.name h1 a,
.name h2 a,
.name h3 a,
.name h4 a,
.name h5 a,
.name h6 a { width: auto; }
10 years ago
input,
10 years ago
select,
10 years ago
.button,
button {
font-size: rem-calc(14);
10 years ago
height: $topbar-input-height;
10 years ago
position: relative;
10 years ago
top: (($topbar-height - $topbar-input-height) / 2);
10 years ago
}
10 years ago
&.expanded {
background: $topbar-bg;
}
10 years ago
}
.contain-to-grid .top-bar {
margin-bottom: $topbar-margin-bottom;
10 years ago
margin: 0 auto;
max-width: $row-width;
10 years ago
}
.top-bar-section {
@include single-transition(none,0,0);
#{$default-float}: 0 !important;
ul {
display: inline;
10 years ago
height: auto !important;
width: auto;
10 years ago
li {
float: $default-float;
.js-generated { display: none; }
}
}
li {
&.hover {
> a:not(.button) {
background-color: $topbar-link-bg-color-hover;
@if ($topbar-link-bg-hover) {
background: $topbar-link-bg-hover;
}
color: $topbar-link-color-hover;
}
}
10 years ago
10 years ago
&:not(.has-form) {
a:not(.button) {
background: $topbar-link-bg;
10 years ago
line-height: $topbar-height;
padding: 0 $topbar-link-padding;
10 years ago
&:hover {
background-color: $topbar-link-bg-color-hover;
@if ($topbar-link-bg-hover) {
background: $topbar-link-bg-hover;
}
}
}
}
10 years ago
10 years ago
&.active:not(.has-form) {
a:not(.button) {
background: $topbar-link-bg-active;
10 years ago
color: $topbar-link-color-active;
line-height: $topbar-height;
padding: 0 $topbar-link-padding;
10 years ago
&:hover {
background: $topbar-link-bg-active-hover;
color: $topbar-link-color-active-hover;
}
}
}
}
.has-dropdown {
10 years ago
@if $topbar-arrows {
> a {
10 years ago
padding-#{$opposite-direction}: $topbar-link-padding + $topbar-link-dropdown-padding !important;
&:after {
@include css-triangle($topbar-dropdown-toggle-size, rgba($topbar-dropdown-toggle-color, $topbar-dropdown-toggle-alpha), top);
margin-top: -($topbar-dropdown-toggle-size / 2);
10 years ago
top: ($topbar-height / 2);
10 years ago
}
}
}
&.moved { position: relative;
10 years ago
> .dropdown {
10 years ago
@include topbar-hide-dropdown();
}
}
&.hover, &.not-click:hover {
10 years ago
> .dropdown {
10 years ago
@include topbar-show-dropdown();
}
}
10 years ago
10 years ago
> a:focus + .dropdown {
@include topbar-show-dropdown();
}
.dropdown li.has-dropdown {
10 years ago
> a {
@if ($topbar-dropdown-arrows) {
10 years ago
&:after {
border: none;
content: "\00bb";
10 years ago
top: rem-calc(3);
10 years ago
#{$opposite-direction}: 5px;
}
10 years ago
}
}
}
}
.dropdown {
#{$default-float}: 0;
background: transparent;
min-width: 100%;
10 years ago
top: auto;
10 years ago
li {
a {
10 years ago
background: $topbar-dropdown-link-bg;
10 years ago
color: $topbar-dropdown-link-color;
line-height: $topbar-height;
padding: 12px $topbar-link-padding;
10 years ago
white-space: nowrap;
10 years ago
}
&:not(.has-form):not(.active) {
10 years ago
> a:not(.button) {
10 years ago
background: $topbar-dropdown-link-bg;
10 years ago
color: $topbar-dropdown-link-color;
10 years ago
}
&:hover > a:not(.button) {
background-color: $topbar-link-bg-color-hover;
10 years ago
color: $topbar-dropdown-link-color-hover;
10 years ago
@if ($topbar-dropdown-link-bg-hover) {
background: $topbar-dropdown-link-bg-hover;
10 years ago
}
}
}
label {
background: $topbar-dropdown-label-bg;
10 years ago
white-space: nowrap;
10 years ago
}
// Second Level Dropdowns
.dropdown {
#{$default-float}: 100%;
top: 0;
}
}
}
10 years ago
> ul > .divider,
> ul > [role="separator"] {
border-#{$opposite-direction}: $topbar-divider-border-bottom;
10 years ago
border-bottom: none;
border-top: none;
clear: none;
height: $topbar-height;
width: 0;
}
.has-form {
background: $topbar-link-bg;
height: $topbar-height;
10 years ago
padding: 0 $topbar-link-padding;
10 years ago
}
// Position overrides for ul.right and ul.left
.#{$opposite-direction} {
10 years ago
li .dropdown {
#{$default-float}: auto;
#{$opposite-direction}: 0;
li .dropdown { #{$opposite-direction}: 100%; }
}
}
.#{$default-float} {
10 years ago
li .dropdown {
#{$opposite-direction}: auto;
#{$default-float}: 0;
li .dropdown { #{$default-float}: 100%; }
}
}
}
// Degrade gracefully when Javascript is disabled. Displays dropdown and changes
// background & text color on hover.
.no-js .top-bar-section {
ul li {
// Apply the hover link color when it has that class
&:hover > a {
background-color: $topbar-link-bg-color-hover;
@if ($topbar-link-bg-hover) {
background: $topbar-link-bg-hover;
}
color: $topbar-link-color-hover;
}
// Apply the active link color when it has that class
&:active > a {
background: $topbar-link-bg-active;
color: $topbar-link-color-active;
}
}
.has-dropdown {
&:hover {
10 years ago
> .dropdown {
10 years ago
@include topbar-show-dropdown();
}
}
10 years ago
10 years ago
> a:focus + .dropdown {
@include topbar-show-dropdown();
}
}
}
}
}
}