refactor to encapsulate all side affects of displaying announcement bnr in one file

This commit is contained in:
captainill 2016-03-08 14:59:06 -08:00
parent a3996491a2
commit a46acfeb25
3 changed files with 34 additions and 18 deletions

View file

@ -6,6 +6,38 @@ $enterprise-bnr-font-weight: 300;
$enterprise-bnr-consul-color: #B52A55; $enterprise-bnr-consul-color: #B52A55;
$enterprise-color-dark-white: #A9B1B5; $enterprise-color-dark-white: #A9B1B5;
body{
// when _announcment-bnr.erb (ie. Consul Enterprise Announcment) is being used in layout we need to push down content to accomodate
// add this class to body
&.-displaying-bnr{
#header{
> .container{
padding-top: 8px;
-webkit-transform: translateY(32px);
-ms-transform: translateY(32px);
transform: translateY(32px);
}
}
#jumbotron {
.container{
.jumbo-logo-wrap{
margin-top: 160px;
}
}
}
&.page-sub{
#header{
> .container{
padding-bottom: 32px;
}
}
}
}
}
#announcement-bnr { #announcement-bnr {
height: 40px; height: 40px;
flex-shrink: 0; flex-shrink: 0;

View file

@ -8,11 +8,6 @@ body.page-sub{
#header{ #header{
@include consul-gradient-bg(); @include consul-gradient-bg();
&.-displaying-bnr{
> .container{
padding-bottom: 32px;
}
}
.navbar-brand { .navbar-brand {
.logo{ .logo{
&:hover{ &:hover{
@ -24,17 +19,6 @@ body.page-sub{
} }
#header { #header {
// when _announcment-bnr.erb (ie. Consul Enterprise Announcment) is being used in layout we need to push down content to accomodate
// add this class
&.-displaying-bnr{
> .container{
padding-top: 8px;
-webkit-transform: translateY(32px);
-ms-transform: translateY(32px);
transform: translateY(32px);
}
}
.navbar-brand { .navbar-brand {
.logo{ .logo{
width: $project-logo-width; width: $project-logo-width;

View file

@ -24,8 +24,8 @@
<%= yield_content :head %> <%= yield_content :head %>
</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}" %> -displaying-bnr">
<div id="header" class="-displaying-bnr navigation <%= current_page.data.page_title == "home" ? "" : "navbar-static-top" %>"> <div id="header" class="navigation <%= current_page.data.page_title == "home" ? "" : "navbar-static-top" %>">
<%= partial "layouts/announcement-bnr" %> <%= partial "layouts/announcement-bnr" %>
<div class="container"> <div class="container">
<div class="row"> <div class="row">