Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
Add hero element
Browse files Browse the repository at this point in the history
Fix #29
  • Loading branch information
bartkozal committed Dec 22, 2015
1 parent 7c686b4 commit ad4f273
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Included features:
* Media object
* Boxes
* Navbar
* Hero
* Sticky footer

Sites built with Hocus-Pocus:
Expand Down
14 changes: 14 additions & 0 deletions docs/hero.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Set `$hero-img` to path to your background. Change `$hero-size` to define
what % of a viewport hero element takes, default is 40.

<div class="example">
<div class="hero">
<h1>Example Title</h1>
</div>
</div>

```html
<div class="hero">
<h1>Example Title</h1>
</div>
```
1 change: 1 addition & 0 deletions docs/template/scss/docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $rwd-type: desktop-first;
$rwd-map: (mobile: 680px);
$navbar-background: #000;
$sticky-footer-height: 60px;
$hero-img: 'https://images.unsplash.com/photo-1442120108414-42e7ea50d0b5';

@import '../../../hocus-pocus';

Expand Down
1 change: 1 addition & 0 deletions docs/template/tag/navigation.tag
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<li><a href="#boxes">Boxes</a></li>
<li><a href="#media">Media</a></li>
<li><a href="#navbar">Navbar</a></li>
<li><a href="#hero">Hero</a></li>
<li><a href="#sticky-footer">Sticky Footer</a></li>
</ul>
</navigation>
1 change: 1 addition & 0 deletions hocus-pocus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@
'scss/box',
'scss/media',
'scss/navbar',
'scss/hero',
'scss/sticky-footer';
3 changes: 3 additions & 0 deletions scss/_defaults.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ $navbar-color: $color-white !default;
$navbar-link-color: $color-white !default;
$navbar-link-background: rgba($color-white, .15) !default;

$hero-img: "/img/bg-hero.png" !default;
$hero-size: 40 !default;

$sticky-footer-height: 0 !default;

$table-zebra-background: rgba($color-ui, .5) !default;
Expand Down
12 changes: 12 additions & 0 deletions scss/_hero.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.hero {
display: flex;
justify-content: center;
align-items: center;
height: #{$hero-size}vh;
background-image: url(#{$hero-img});
background-repeat: no-repeat;
background-position: 50% 50%;
background-size: cover;
background-attachment: fixed;
text-align: center;
}

0 comments on commit ad4f273

Please sign in to comment.