Skip to content

Commit

Permalink
Update sidebar layout styles to reflect new design
Browse files Browse the repository at this point in the history
Also modifies the existing nav_class helper to become a broader
layout_class helper, so it can be used on the body as well as
the nav.

Signed-off-by: Maggie Walker <[email protected]>

Pull request: #642
Approved by: cwebberOps
  • Loading branch information
magwalk authored and thesentinels committed Jun 3, 2016
1 parent a3ed814 commit f47a817
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 19 deletions.
2 changes: 1 addition & 1 deletion www/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
helpers SidebarHelpers

helpers do
def nav_class
def layout_class
layout = current_page.options.fetch(:layout, nil)
layout == :sidebar ? 'has-sidebar' : ''
end
Expand Down
14 changes: 5 additions & 9 deletions www/source/about/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ p
Networks grep rsync diff. chmod cron sideband demultiplexer rbash push
preview environment SQL Varnish pub key
hr
p
small Continue to the next topic
br
a href="#" Who should use habitat?
hr
p
small
| Copyright: This work is licensed under xxxxx <br/>
Provide feedback on habitat documentation.
ul.main-content--link-nav
li Continue to the next article
li
a href="/docs/package-contents" Package contents

Binary file added www/source/images/graphics/article-watermark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions www/source/images/graphics/article-watermark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion www/source/layouts/_nav.slim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#main-nav class="#{nav_class}"
#main-nav class="#{layout_class}"
.main-nav--container.clearfix
.main-nav--logo
a href="/"
Expand Down
2 changes: 1 addition & 1 deletion www/source/layouts/layout.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ html

== stylesheet_link_tag :site

body class="#{current_page.data.classes}"
body class="#{current_page.data.classes} #{layout_class}"
= partial "layouts/gtm"

= partial "layouts/nav"
Expand Down
10 changes: 8 additions & 2 deletions www/source/stylesheets/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@
margin: 0;

li:first-child {
color: $hab-gray;
color: lighten($body-font-color, 25%);
font-size: rem-calc(12);
margin: rem-calc(30) 0 rem-calc(10);
}

a {
color: $body-font-color;
font-size: rem-calc(14);
margin: rem-calc(40) 0 rem-calc(10);
text-decoration: underline;
}
}

Expand Down
49 changes: 44 additions & 5 deletions www/source/stylesheets/_layout.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
$sidebar-breakpoint: 720px;

body.has-sidebar {
background: $hab-off-white;

#content-outer {
margin-bottom: rem-calc(90);
}
}

#content-outer {
@include small-nav {
padding-top: $header-height-mobile;
Expand All @@ -21,6 +29,10 @@ $sidebar-breakpoint: 720px;
margin: 0 auto;
min-height: 675px;
max-height: auto;

hr {
border-bottom-color: lighten($hab-gray, 20%);
}
}

.main-sidebar {
Expand All @@ -34,6 +46,35 @@ $sidebar-breakpoint: 720px;
bottom: 0;
width: 300px;
}

a {
display: block;
position: relative;
color: $body-font-color;

&:hover,
&:active,
&:focus {
color: $hab-primary;
}
}

.is-active > a {
font-weight: bold;
color: $hab-primary;

&:before {
content: "";
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: rem-calc(12);
height: rem-calc(12);
background: url('/images/icons/sidebar-active.png') no-repeat;
background-size: 100% auto;
}
}
}

.main-sidebar--search {
Expand All @@ -52,15 +93,13 @@ $sidebar-breakpoint: 720px;
display: block;
line-height: rem-calc(32);
padding-left: 0;

&.is-active > a {
font-weight: bold;
}
}

.main-content__has-sidebar {
background-color: $hab-white;
padding: rem-calc(40) rem-calc(20);
background: url("/images/graphics/article-watermark.png") no-repeat right bottom $hab-white;
background: url("/images/graphics/article-watermark.svg") no-repeat right bottom $hab-white;
padding: rem-calc(40) rem-calc(20) rem-calc(120);

@media (min-width: $sidebar-breakpoint) {
margin-left: 300px;
Expand Down

0 comments on commit f47a817

Please sign in to comment.