refactor styles to be more atomic for header/footer usage

This commit is contained in:
captainill 2015-11-09 15:34:32 -08:00
parent 595f090851
commit 88f86c6255
6 changed files with 275 additions and 276 deletions

View File

@ -1,140 +1,58 @@
#footer{ #footer{
padding: 64px 0; padding: 64px 0;
// @include consul-gradient-bg();
background-color: $black; background-color: $black;
.footer-links{ .hashicorp-project{
li{ margin-top: 24px;
&.edit{
a{
text-transform: uppercase;
letter-spacing: 1px;
font-size: 11px;
font-weight: 400;
}
}
a{
@include hashi-a-style();
@include project-a-style();
@include project-footer-a-style();
}
}
} }
.pull-right{ .pull-right{
padding-right: 15px; padding-right: 15px;
} }
.footer-hashi{
font-size: 14px;
color: $black;
a{
color: $black;
font-weight: 600;
}
span{
margin-right: 4px;
}
.hashicorp-project{
display: inline-block;
height: 30px;
line-height: 30px;
text-decoration: none;
&.white{
color: white;
svg{
path,
polygon{
fill: white;
}
line{
stroke: white;
}
}
}
&:hover{
svg{
&.svg-by{
line{
stroke: $purple;
}
}
}
}
span{
font-family: $header-font-family;
font-weight: 500;
}
span,
svg{
display: inline-block;
}
svg{
&.svg-by{
width: $by-hashicorp-width;
height: $by-hashicorp-height;
margin-bottom: -4px;
margin-left: -3px;
}
&.svg-logo{
width: 30px;
height: 30px;
margin-bottom: -10px;
margin-left: -1px;
}
path,
line{
fill: $black;
@include transition(all 300ms ease-in);
&:hover{
@include transition(all 300ms ease-in);
}
}
}
}
}
} }
@media (max-width: 768px) { @media (max-width: 768px) {
#footer{ #footer{
text-align: center; text-align: center;
.footer-links{
float: none;
display: inline-block;
margin-bottom: 36px;
}
.footer-hashi { .footer-hashi {
float: none; float: none !important;
display: inline-block; display: block;
.pull-right{ .pull-right{
float: none !important; float: none !important;
padding-right: 0; padding-right: 0;
} }
} }
ul{
float: none;
display: inline-block;
margin-bottom: 36px;
}
} }
} }
@media (max-width: 414px) { @media (max-width: 414px) {
#footer{ #footer{
.footer-links{ ul{
display: block;
li{ li{
display: block; display: block;
float: none; float: none;
} }
&.external-links{
li{
svg{
position: relative;
left: 0;
top: 2px;
margin-top: 0;
margin-right: 4px;
}
}
}
} }
} }
} }

View File

@ -33,8 +33,7 @@ body.page-sub{
} }
} }
.by{ .by-hashicorp{
color: $black;
&:hover{ &:hover{
svg{ svg{
line{ line{
@ -47,27 +46,6 @@ body.page-sub{
.buttons{ .buttons{
margin-top: 2px; //baseline everything margin-top: 2px; //baseline everything
ul.navbar-nav{
li {
// &:hover{
// svg path{
// fill: $purple;
// }
// }
svg path{
fill: $white;
}
}
}
}
.main-links,
.external-links {
li > a {
@include project-a-style();
}
} }
} }

View File

@ -4,33 +4,21 @@
// - Edits should not be made here // - Edits should not be made here
// -------------------------------------------------- // --------------------------------------------------
#header { #header{
position: relative; position: relative;
margin-bottom: 0;
}
.navigation {
color: black; color: black;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
margin-bottom: 0;
transition: all 1s ease; transition: all 1s ease;
&.white{ &.white{
color: white;
.navbar-brand { .navbar-brand {
.logo { .logo {
color: white; color: white;
} }
.by{
color: white;
font-weight: 300;
svg{
path,
polygon{
fill: white;
}
line{
stroke: white;
}
}
}
} }
.main-links, .main-links,
@ -41,21 +29,8 @@
} }
} }
} }
.nav > li > a:hover, .nav > li > a:focus {
color: white;
} }
.navbar-header{
.navbar-toggle{
.icon-bar{
border: 1px solid white;
}
}
}
}
.navbar-header{
.navbar-toggle{ .navbar-toggle{
height: $header-height; height: $header-height;
margin: 0; margin: 0;
@ -65,13 +40,76 @@
border-radius: 0; border-radius: 0;
} }
} }
.external-links {
&.white{
svg path{
fill: $white;
}
} }
.navbar-brand { li {
position: relative;
svg path{
@include transition( all 300ms ease-in );
}
&:hover{
svg path{
@include transition( all 300ms ease-in );
}
}
&.download{
margin-right: 10px;
}
> a {
padding-left: 12px !important;
svg{
position: absolute;
left: -12px;
top: 50%;
margin-top: -7px;
width: 14px;
height: 14px;
}
}
}
}
.main-links{
margin-right: $nav-margin-right * 2;
}
.main-links,
.external-links {
&.white{
li > a {
color: white;
}
}
li > a {
@include hashi-a-style();
margin: 0 10px;
padding-top: 1px;
line-height: $header-height;
@include project-a-style();
}
}
.nav > li > a:hover, .nav > li > a:focus {
background-color: transparent;
@include transition( all 300ms ease-in );
}
}
.navbar-brand {
display: block; display: block;
height: $header-height; height: $header-height;
padding: 0; padding: 0;
margin: 0 10px 0 0 ; margin: 0 10px 0 0;
.logo{ .logo{
display: inline-block; display: inline-block;
@ -88,8 +126,17 @@
text-decoration: none; text-decoration: none;
} }
} }
}
.by{ .navbar-toggle{
&.white{
.icon-bar{
border: 1px solid white;
}
}
}
.by-hashicorp{
display: inline-block; display: inline-block;
vertical-align:top; vertical-align:top;
height: $header-height; height: $header-height;
@ -102,6 +149,25 @@
font-size: 0; font-size: 0;
text-decoration: none; text-decoration: none;
&.white{
color: white;
font-weight: 300;
svg{
path,
polygon{
fill: white;
}
line{
stroke: white;
}
}
}
&:focus,
&:hover{
text-decoration: none;
}
.svg-wrap{ .svg-wrap{
font-size: 13px; font-size: 13px;
} }
@ -139,78 +205,105 @@
} }
} }
} }
}
.hashicorp-project{
display: inline-block;
height: 30px;
line-height: 30px;
text-decoration: none;
font-size: 14px;
color: $black;
font-weight: 600;
&.white{
color: white;
svg{
path,
polygon{
fill: white;
}
line{
stroke: white;
}
} }
} }
.external-links { &:focus{
li { text-decoration: none;
position: relative;
svg path{
@include transition( all 300ms ease-in );
} }
&:hover{ &:hover{
svg path{ text-decoration: none;
@include transition( all 300ms ease-in );
}
}
&.download{
margin-right: 10px;
}
> a {
padding-left: 12px !important;
svg{ svg{
position: absolute; &.svg-by{
left: -12px; line{
top: 50%; stroke: $purple;
margin-top: -7px;
width: 14px;
height: 14px;
} }
} }
} }
} }
.main-links{ span{
margin-right: $nav-margin-right * 2; margin-right: 4px;
font-family: $header-font-family;
font-weight: 500;
} }
.main-links, span,
.external-links { svg{
li > a { display: inline-block;
@include hashi-a-style();
margin: 0 10px;
padding-top: 1px;
line-height: $header-height;
}
} }
.nav > li > a:hover, .nav > li > a:focus { svg{
background-color: transparent; &.svg-by{
color: $black; width: $by-hashicorp-width;
@include transition( all 300ms ease-in ); height: $by-hashicorp-height;
margin-bottom: -4px;
margin-left: -3px;
}
&.svg-logo{
width: 30px;
height: 30px;
margin-bottom: -10px;
margin-left: -1px;
}
path,
line{
fill: $black;
@include transition(all 300ms ease-in);
&:hover{
@include transition(all 300ms ease-in);
}
}
} }
} }
@media (max-width: 992px) { @media (max-width: 992px) {
#header { .navigation {
> .container{ > .container{
width: 100%; width: 100%;
} }
} }
} }
@media (max-width: 768px) {
.navigation {
.main-links{
margin-right: 0;
}
}
}
@media (max-width: 414px) { @media (max-width: 414px) {
#header { #header {
.navbar-header{
.navbar-toggle{ .navbar-toggle{
padding-top: 10px; padding-top: 10px;
height: $header-mobile-height; height: $header-mobile-height;
} }
}
.navbar-brand { .navbar-brand {
height: $header-mobile-height; height: $header-mobile-height;
@ -219,7 +312,7 @@
height: $header-mobile-height; height: $header-mobile-height;
line-height: $header-mobile-height; line-height: $header-mobile-height;
} }
.by{ .by-hashicorp{
height: $header-mobile-height; height: $header-mobile-height;
line-height: $header-mobile-height; line-height: $header-mobile-height;
padding-top: 0; padding-top: 0;

View File

@ -10,12 +10,12 @@ $project-logo-pad-left: 0px;
// Mixins // Mixins
@mixin project-a-style{ @mixin project-a-style{
color: $white;
font-weight: 300; font-weight: 300;
opacity: .75; opacity: .75;
&:hover{ &:hover{
color: $white; color: $white;
opacity: 1;
} }
} }

View File

@ -1,8 +1,9 @@
<div id="footer"> <div id="footer" class="navigation">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-sm-6 col-xs-12"> <div class="col-xs-12">
<ul class="footer-links nav navbar-nav"> <div>
<ul class="main-links white nav navbar-nav">
<li><a href="/intro/index.html">Intro</a></li> <li><a href="/intro/index.html">Intro</a></li>
<li><a href="/docs/index.html">Docs</a></li> <li><a href="/docs/index.html">Docs</a></li>
<li><a href="/community.html">Community</a></li> <li><a href="/community.html">Community</a></li>
@ -11,9 +12,17 @@
<li class="edit"><a href="<%= github_url :current_page %>">Edit this page</a></li> <li class="edit"><a href="<%= github_url :current_page %>">Edit this page</a></li>
<% end %> <% end %>
</ul> </ul>
</div> <ul class="external-links white nav navbar-nav">
<div class="footer-hashi col-sm-6 col-xs-12"> <li class="first download">
<div class="pull-right"> <a href="/downloads.html"><%= partial "layouts/svg/svg-download" %>Download</a>
</li>
<li class="github">
<a href="https://github.com/hashicorp/consul"><%= partial "layouts/svg/svg-github" %>GitHub</a>
</li>
</ul>
</ div>
<div class="footer-hashi pull-right">
<div class="">
<a class="hashicorp-project white" href="https://www.hashicorp.com"> <a class="hashicorp-project white" href="https://www.hashicorp.com">
<span class="project-text">A </span> <span class="project-text">A </span>
<%= partial "layouts/svg/svg-by-hashicorp" %> <%= partial "layouts/svg/svg-by-hashicorp" %>
@ -24,6 +33,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
</div> </div>

View File

@ -25,16 +25,16 @@
</head> </head>
<body class="page-<%= current_page.data.page_title ? "#{current_page.data.page_title} layout-#{current_page.data.layout} page-sub" : "home layout-#{current_page.data.layout}" %>"> <body class="page-<%= current_page.data.page_title ? "#{current_page.data.page_title} layout-#{current_page.data.layout} page-sub" : "home layout-#{current_page.data.layout}" %>">
<div id="header" class="white <%= current_page.data.page_title == "home" ? "" : "navbar-static-top" %>"> <div id="header" class="navigation <%= current_page.data.page_title == "home" ? "" : "navbar-static-top" %>">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="navbar-header"> <div class="navbar-header">
<div class="navbar-brand"> <div class="navbar-brand">
<a class="logo" href="/"><img src="<%= image_path('wordtype@2x.png') %>" width="96px" height="18px">Consul</a> <a class="logo" href="/"><img src="<%= image_path('wordtype@2x.png') %>" width="96px" height="18px">Consul</a>
<a class="by" href="https://hashicorp.com/"><span class="svg-wrap">by</span><%= partial "layouts/svg/svg-by-hashicorp" %><%= partial "layouts/svg/svg-hashicorp-logo" %>Hashicorp</a> <a class="by-hashicorp white" href="https://hashicorp.com/"><span class="svg-wrap">by</span><%= partial "layouts/svg/svg-by-hashicorp" %><%= partial "layouts/svg/svg-hashicorp-logo" %>Hashicorp</a>
</div> </div>
<button class="navbar-toggle" type="button"> <button class="navbar-toggle white" type="button">
<span class="sr-only">Toggle navigation</span> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
@ -42,8 +42,8 @@
</button> </button>
</div> </div>
<div class="buttons hidden-xs"> <div class="buttons hidden-xs">
<nav role="navigation"> <nav class="navigation-links" role="navigation">
<ul class="external-links nav navbar-nav navbar-right"> <ul class="external-links white nav navbar-nav navbar-right">
<li class="first download"> <li class="first download">
<a href="/downloads.html"><%= partial "layouts/svg/svg-download" %>Download</a> <a href="/downloads.html"><%= partial "layouts/svg/svg-download" %>Download</a>
</li> </li>
@ -51,7 +51,7 @@
<a href="https://github.com/hashicorp/consul"><%= partial "layouts/svg/svg-github" %>GitHub</a> <a href="https://github.com/hashicorp/consul"><%= partial "layouts/svg/svg-github" %>GitHub</a>
</li> </li>
</ul> </ul>
<ul class="main-links nav navbar-nav navbar-right"> <ul class="main-links white nav navbar-nav navbar-right">
<li class="first li-under"><a href="/intro/index.html">Intro</a></li> <li class="first li-under"><a href="/intro/index.html">Intro</a></li>
<li class="li-under"><a href="/docs/index.html">Docs</a></li> <li class="li-under"><a href="/docs/index.html">Docs</a></li>
<li class="li-under"><a href="/community.html">Community</a></li> <li class="li-under"><a href="/community.html">Community</a></li>