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 @@
body.page-sub{
#footer-wrap{ #footer{
background-color: white; padding: 40px 0;
padding: 0 0 50px 0; margin-top: 0;
} }
body.page-home{
#footer{
margin-top: -40px;
}
} }
#footer{ #footer{
padding: 140px 0 40px; background-color: white;
color: black; padding: 100px 0 60px;
margin-top: -40px;
a{
color: black;
}
&.white{
background-color: $black;
.footer-links{ .footer-links{
margin-bottom: 20px; li > a {
@include project-footer-a-subpage-style();
.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;
}
}
}
} }
}
.buttons.navbar-nav{ .footer-links{
float: none; li > a {
display: inline-block; @include project-footer-a-style();
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-hashi{ .hashicorp-project{
float: right; margin-top: 24px;
padding-top: 5px; }
letter-spacing: 2px;
a{ .pull-right{
color: black; padding-right: 15px;
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);
}
}
}
} }
.page-sub{ .edit-page-link{
#footer-wrap{ position: absolute;
padding: 0; top: -70px;
} right: 30px;;
#footer{ a{
padding: 140px 0 100px; text-transform: uppercase;
background-color: $black; color: $black;
transform: none; font-size: 13px;
}
>.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;
}
}
} }
@media (max-width: 992px) { @media (max-width: 992px) {
.page-sub #footer, #footer{ .footer-links {
.footer-hashi { display: block;
padding-top: 14px; text-align: center;
span{
margin-right: 6px; ul{
} display: inline-block;;
.hashi-logo{ float: none !important;
i{
margin-top: -6px;
width: 20px;
height: 22px;
background-size: 20px 22px;
}
}
}
} }
.footer-hashi{
} display: 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;
}
}
} }
}
} }
@media (max-width: 320px) { @media (max-width: 414px) {
#footer{ #footer{
text-align: center; ul{
display: block;
li{
display: block;
float: none;
}
.footer-links{ &.external-links{
.li-under{ li{
float: none !important; 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 // - 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,109 +29,40 @@
} }
} }
} }
}
.nav > li > a:hover, .nav > li > a:focus { &.black{
color: white; .navbar-brand {
.logo {
color: black;
}
} }
.navbar-header{ .main-links,
.navbar-toggle{ .external-links {
.icon-bar{ li > a {
border: 1px solid white; color: black;
}
} }
} }
} }
.navbar-header{ .navbar-toggle{
.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;
height: $header-height; height: $header-height;
padding: 0; margin: 0;
margin: 0 10px 0 0 ; border-radius: 0;
.icon-bar{
.logo{ border: 1px solid $black;
display: inline-block; border-radius: 0;
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);
}
}
}
} }
} }
.external-links { .external-links {
&.white{
svg path{
fill: $white;
}
}
li { li {
position: relative; position: relative;
@ -157,6 +76,8 @@
} }
} }
@include project-svg-external-links-style();
&.download{ &.download{
margin-right: 10px; margin-right: 10px;
} }
@ -181,28 +102,222 @@
.main-links, .main-links,
.external-links { .external-links {
&.white{
li > a {
color: white;
}
}
li > a { li > a {
@include hashi-a-style(); @include hashi-a-style();
margin: 0 10px; margin: 0 10px;
padding-top: 1px; padding-top: 1px;
line-height: $header-height; line-height: $header-height;
@include project-a-style();
} }
} }
.nav > li > a:hover, .nav > li > a:focus { .nav > li > a:hover, .nav > li > a:focus {
background-color: transparent; background-color: transparent;
color: $black;
@include transition( all 300ms ease-in ); @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) { @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 {
@ -212,7 +327,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

@ -16,5 +16,56 @@ $project-logo-pad-left: 8px;
&:hover{ &:hover{
color: $white; 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 class="skew-item ">
<div id="footer"> <div id="footer" class="navigation <%= current_page.url == "/" ? "black" : "white" %>">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="footer-links col-sm-7 col-xs-12"> <div class="col-xs-12">
<ul class="footer-links nav navbar-nav"> <% if current_page.url != '/' %>
<li class="li-under"><a href="/intro/index.html">Intro</a></li> <div class="edit-page-link"><a href="<%= github_url :current_page %>">Edit this page</a></div>
<li class="active li-under"><a href="/docs/index.html">Docs</a></li> <% end %>
<li class="li-under"><a href="/community.html">Community</a></li> <div class="footer-links">
<% if current_page.url != '/' %> <ul class="main-links nav navbar-nav">
<li class="li-under"><a href="<%= github_url :current_page %>">Edit this page</a></li> <li><a href="/intro/index.html">Intro</a></li>
<% end %> <li><a href="/docs/index.html">Docs</a></li>
</ul> <li><a href="/community.html">Community</a></li>
</div> <li><a href="/security.html">Security</a></li>
<div class="footer-hashi col-sm-5 col-xs-12"> </ul>
<div class="pull-right"> <ul class="external-links nav navbar-nav">
<span>Copyright &copy; <%= Time.now.year %>. A <a href="https://www.hashicorp.com">HashiCorp</a> Project.</span> <li class="first download">
<a class="hashi-logo" href="https://www.hashicorp.com"><i class="hashi-logo"></i></a> <a href="/downloads.html"><%= partial "layouts/svg/svg-download" %>Download</a>
</div> </li>
</div> <li class="github">
</div> <a href="https://github.com/hashicorp/terraform"><%= partial "layouts/svg/svg-github" %>GitHub</a>
</div> </li>
<div class="skew-item" id="footer-bg"></div> </ul>
</div> </ div>
</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> </div>
<script> <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="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="/">Terraform</a> <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> </div>
<button class="navbar-toggle" type="button"> <button class="navbar-toggle" type="button">
<span class="sr-only">Toggle navigation</span> <span class="sr-only">Toggle navigation</span>
@ -15,7 +15,7 @@
</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 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>