use more atomic styles for header/footer classes. use page url to determin class names

This commit is contained in:
captainill 2015-11-09 22:11:00 -08:00
parent b33c3fcd0d
commit ebec7e2bc2
5 changed files with 387 additions and 328 deletions

View File

@ -1,210 +1,88 @@
#footer-wrap{
background-color: white;
padding: 0 0 50px 0;
}
body.page-home{
#footer{
margin-top: -40px;
}
body.page-sub{
#footer{
padding: 40px 0;
margin-top: 0;
}
}
#footer{
padding: 140px 0 40px;
color: black;
a{
color: black;
}
background-color: white;
padding: 100px 0 60px;
margin-top: -40px;
&.white{
background-color: $black;
.footer-links{
margin-bottom: 20px;
.li-under a:hover::after,
.li-under a:focus::after {
opacity: 1;
-webkit-transform: skewY(15deg) translateY(8px);
-moz-transform: skewY(15deg) translateY(8px);
transform: skewY(15deg) translateY(8px);
}
.li-under a::after {
background-color: $purple;
}
li{
a{
text-transform: uppercase;
font-size: 12px;
letter-spacing: 3px;
@include transition( color 0.3s ease );
font-weight: 400;
&:hover{
color: $purple;
@include transition( color 0.3s ease );
background-color: transparent;
}
}
}
li > a {
@include project-footer-a-subpage-style();
}
}
}
.buttons.navbar-nav{
float: none;
display: inline-block;
margin-bottom: 30px;
margin-top: 0px;
li{
&.first{
margin-right: 12px;
}
&.download{
a{
background: image-url('icon-download-purple.png') 8px 6px no-repeat;
@include img-retina("icon-download-purple.png", "icon-download-purple@2x.png", 20px, 20px);
}
}
&.github{
a{
background: image-url('icon-github-purple.png') 8px 6px no-repeat;
@include img-retina("icon-github-purple.png", "icon-github-purple@2x.png", 20px, 20px);
}
}
}
li > a {
padding-top: 6px;
padding-bottom: 6px;
padding-left: 40px;
}
.footer-links{
li > a {
@include project-footer-a-style();
}
}
.footer-hashi{
float: right;
padding-top: 5px;
letter-spacing: 2px;
.hashicorp-project{
margin-top: 24px;
}
a{
color: black;
font-weight: $font-weight-lato-xb;
}
span{
margin-right: 10px;
}
.hashi-logo{
display: inline-block;
vertical-align: middle;
i{
display: inline-block;
width: 37px;
height: 40px;
background: image-url('footer-hashicorp-logo.png') 0 0 no-repeat;
@include img-retina("footer-hashicorp-logo.png", "footer-hashicorp-logo@2x.png", 37px, 40px);
}
}
}
.pull-right{
padding-right: 15px;
}
}
.page-sub{
#footer-wrap{
padding: 0;
}
.edit-page-link{
position: absolute;
top: -70px;
right: 30px;;
#footer{
padding: 140px 0 100px;
background-color: $black;
transform: none;
>.container{
transform: none;
}
a{
color: white;
}
.footer-hashi{
color: white;
.hashi-logo{
i{
background: image-url('footer-hashicorp-white-logo.png') 0 0 no-repeat;
@include img-retina("footer-hashicorp-white-logo.png", "footer-hashicorp-white-logo@2x.png", 37px, 40px);
}
}
}
}
}
@media (min-width: 1500px) {
body.page-home{
#footer{
margin-top: -60px;
padding: 190px 0 40px;
}
}
a{
text-transform: uppercase;
color: $black;
font-size: 13px;
}
}
@media (max-width: 992px) {
.page-sub #footer, #footer{
.footer-hashi {
padding-top: 14px;
span{
margin-right: 6px;
}
.hashi-logo{
i{
margin-top: -6px;
width: 20px;
height: 22px;
background-size: 20px 22px;
}
}
}
.footer-links {
display: block;
text-align: center;
ul{
display: inline-block;;
float: none !important;
}
}
@media (max-width: 768px) {
#footer{
padding: 100px 0 40px;
text-align: center;
.footer-links{
float: none;
display: inline-block;
}
.footer-hashi {
float: none;
display: inline-block;
.pull-right{
float: none !important;
}
}
.footer-hashi{
display: block;
float: none !important;
}
}
}
@media (max-width: 320px) {
#footer{
text-align: center;
@media (max-width: 414px) {
#footer{
ul{
display: block;
li{
display: block;
float: none;
}
.footer-links{
.li-under{
float: none !important;
}
&.external-links{
li{
svg{
position: relative;
left: 0;
top: 2px;
margin-top: 0;
margin-right: 4px;
}
}
}
}
}
}

View File

@ -4,33 +4,21 @@
// - Edits should not be made here
// --------------------------------------------------
#header {
#header{
position: relative;
margin-bottom: 0;
}
.navigation {
color: black;
text-rendering: optimizeLegibility;
margin-bottom: 0;
transition: all 1s ease;
&.white{
color: white;
.navbar-brand {
.logo {
color: white;
}
.by{
color: white;
font-weight: 300;
svg{
path,
polygon{
fill: white;
}
line{
stroke: white;
}
}
}
}
.main-links,
@ -41,109 +29,40 @@
}
}
}
}
.nav > li > a:hover, .nav > li > a:focus {
color: white;
&.black{
.navbar-brand {
.logo {
color: black;
}
}
.navbar-header{
.navbar-toggle{
.icon-bar{
border: 1px solid white;
}
.main-links,
.external-links {
li > a {
color: black;
}
}
}
.navbar-header{
.navbar-toggle{
height: $header-height;
margin: 0;
padding-right: 15px;
border-radius: 0;
.icon-bar{
border: 1px solid $black;
border-radius: 0;
}
}
}
.navbar-brand {
display: block;
.navbar-toggle{
height: $header-height;
padding: 0;
margin: 0 10px 0 0 ;
.logo{
display: inline-block;
height: $header-height;
vertical-align:top;
padding: 0;
line-height: $header-height;
padding-left: $project-logo-width + $project-logo-pad-left;
background-position: 0 center;
@include transition(all 300ms ease-in);
&:hover{
@include transition(all 300ms ease-in);
text-decoration: none;
}
}
.by{
display: inline-block;
vertical-align:top;
height: $header-height;
margin-left: 3px;
padding-top: 2px;
color: black;
line-height: $header-height;
font-family: $header-font-family;
font-weight: 600;
font-size: 0;
text-decoration: none;
.svg-wrap{
font-size: 13px;
}
svg{
&.svg-by{
width: $by-hashicorp-width;
height: $by-hashicorp-height;
margin-bottom: -4px;
margin-left: 4px;
}
&.svg-logo{
width: 16px;
height: 16px;
margin-bottom: -3px;
margin-left: 4px;
}
path,
polygon{
fill: black;
@include transition(all 300ms ease-in);
&:hover{
@include transition(all 300ms ease-in);
}
}
line{
stroke: black;
@include transition(all 300ms ease-in);
&:hover{
@include transition(all 300ms ease-in);
}
}
}
margin: 0;
border-radius: 0;
.icon-bar{
border: 1px solid $black;
border-radius: 0;
}
}
.external-links {
&.white{
svg path{
fill: $white;
}
}
li {
position: relative;
@ -157,6 +76,8 @@
}
}
@include project-svg-external-links-style();
&.download{
margin-right: 10px;
}
@ -181,28 +102,222 @@
.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;
color: $black;
@include transition( all 300ms ease-in );
}
}
.navbar-brand {
display: block;
height: $header-height;
padding: 0;
margin: 0 10px 0 0;
.logo{
display: inline-block;
height: $header-height;
vertical-align:top;
padding: 0;
line-height: $header-height;
padding-left: $project-logo-width + $project-logo-pad-left;
background-position: 0 center;
@include transition(all 300ms ease-in);
&:hover{
@include transition(all 300ms ease-in);
text-decoration: none;
}
}
}
.navbar-toggle{
&.white{
.icon-bar{
border: 1px solid white;
}
}
}
.by-hashicorp{
display: inline-block;
vertical-align:top;
height: $header-height;
margin-left: 3px;
padding-top: 2px;
color: black;
line-height: $header-height;
font-family: $header-font-family;
font-weight: 600;
font-size: 0;
text-decoration: none;
&.white{
color: white;
font-weight: 300;
svg{
path,
polygon{
fill: white;
}
line{
stroke: white;
}
}
&:focus,
&:hover{
text-decoration: none;
color: white;
}
}
&:focus,
&:hover{
text-decoration: none;
}
.svg-wrap{
font-size: 13px;
}
svg{
&.svg-by{
width: $by-hashicorp-width;
height: $by-hashicorp-height;
margin-bottom: -4px;
margin-left: 4px;
}
&.svg-logo{
width: 16px;
height: 16px;
margin-bottom: -3px;
margin-left: 4px;
}
path,
polygon{
fill: black;
@include transition(all 300ms ease-in);
&:hover{
@include transition(all 300ms ease-in);
}
}
line{
stroke: black;
@include transition(all 300ms ease-in);
&:hover{
@include transition(all 300ms ease-in);
}
}
}
}
.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;
}
}
}
&:focus{
text-decoration: none;
}
&:hover{
text-decoration: none;
svg{
&.svg-by{
line{
stroke: $purple;
}
}
}
}
span{
margin-right: 4px;
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: 480px) {
.navigation {
.main-links{
margin-right: 0;
}
}
}
@media (max-width: 414px) {
#header {
.navbar-header{
.navbar-toggle{
padding-top: 10px;
height: $header-mobile-height;
}
.navbar-toggle{
padding-top: 10px;
height: $header-mobile-height;
}
.navbar-brand {
@ -212,7 +327,7 @@
height: $header-mobile-height;
line-height: $header-mobile-height;
}
.by{
.by-hashicorp{
height: $header-mobile-height;
line-height: $header-mobile-height;
padding-top: 0;

View File

@ -16,5 +16,56 @@ $project-logo-pad-left: 8px;
&:hover{
color: $white;
opacity: 1;
}
}
@mixin project-footer-a-style{
color: $black;
font-weight: 400;
&:hover{
color: $purple;
svg path{
fill: $purple;
}
}
}
@mixin project-footer-a-subpage-style{
color: $white;
font-weight: 400;
svg path{
fill: $white;
}
&:hover{
color: $purple;
svg path{
fill: $purple;
}
}
}
@mixin project-svg-external-links-style{
svg path{
fill: $black;
}
&:hover{
svg path{
fill: $blue;
}
}
}
@mixin project-by-hashicorp-style{
&:hover{
line{
stroke: $blue;
}
}
}

View File

@ -1,28 +1,43 @@
<div class="skew-item" id="footer-wrap">
<div id="footer">
<div class="container">
<div class="row">
<div class="footer-links col-sm-7 col-xs-12">
<ul class="footer-links nav navbar-nav">
<li class="li-under"><a href="/intro/index.html">Intro</a></li>
<li class="active li-under"><a href="/docs/index.html">Docs</a></li>
<li class="li-under"><a href="/community.html">Community</a></li>
<% if current_page.url != '/' %>
<li class="li-under"><a href="<%= github_url :current_page %>">Edit this page</a></li>
<% end %>
</ul>
</div>
<div class="footer-hashi col-sm-5 col-xs-12">
<div class="pull-right">
<span>Copyright &copy; <%= Time.now.year %>. A <a href="https://www.hashicorp.com">HashiCorp</a> Project.</span>
<a class="hashi-logo" href="https://www.hashicorp.com"><i class="hashi-logo"></i></a>
</div>
</div>
</div>
</div>
<div class="skew-item" id="footer-bg"></div>
</div>
</div>
<div class="skew-item ">
<div id="footer" class="navigation <%= current_page.url == "/" ? "black" : "white" %>">
<div class="container">
<div class="row">
<div class="col-xs-12">
<% if current_page.url != '/' %>
<div class="edit-page-link"><a href="<%= github_url :current_page %>">Edit this page</a></div>
<% end %>
<div class="footer-links">
<ul class="main-links nav navbar-nav">
<li><a href="/intro/index.html">Intro</a></li>
<li><a href="/docs/index.html">Docs</a></li>
<li><a href="/community.html">Community</a></li>
<li><a href="/security.html">Security</a></li>
</ul>
<ul class="external-links nav navbar-nav">
<li class="first download">
<a href="/downloads.html"><%= partial "layouts/svg/svg-download" %>Download</a>
</li>
<li class="github">
<a href="https://github.com/hashicorp/terraform"><%= partial "layouts/svg/svg-github" %>GitHub</a>
</li>
</ul>
</ div>
<div class="footer-hashi pull-right">
<div class="">
<a class="hashicorp-project <%= current_page.url == "/" ? "black" : "white" %>" href="https://www.hashicorp.com">
<span class="project-text">A </span>
<%= partial "layouts/svg/svg-by-hashicorp" %>
<span class="project-text">Project</span>
<%= partial "layouts/svg/svg-hashicorp-logo" %>
</a>
</div>
</div>
</div>
</div>
<div class="skew-item" id="footer-bg"></div>
</div>
</div>
</div>
</div>
<script>

View File

@ -1,11 +1,11 @@
<div id="header" class="white <%= current_page.data.page_title == "home" ? "" : "navbar-static-top" %>">
<div id="header" class="navigation white <%= current_page.data.page_title == "home" ? "" : "navbar-static-top" %>">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="navbar-header">
<div class="navbar-brand">
<a class="logo" href="/">Terraform</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>
<button class="navbar-toggle" type="button">
<span class="sr-only">Toggle navigation</span>
@ -15,7 +15,7 @@
</button>
</div>
<div class="buttons hidden-xs">
<nav role="navigation">
<nav class="navigation-links" role="navigation">
<ul class="external-links nav navbar-nav navbar-right">
<li class="first download">
<a href="/downloads.html"><%= partial "layouts/svg/svg-download" %>Download</a>