-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Homepage banner pattern (#784)
* add homepage banner image * add homepage banner styles * add homepage banner component and documentation * update comment
- Loading branch information
Showing
8 changed files
with
113 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@import "./homepage-banner/homepage-banner"; | ||
|
||
.wmnds-banner-container { | ||
$self: &; | ||
padding: $size-md 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% raw %} | ||
{% from "wmnds/patterns/banner/homepage-banner/_homepage-banner.njk" import wmndsHomepageBanner %} | ||
{{ | ||
wmndsHomepageBanner({ | ||
titleHTML: "Bringing transport <br>together", | ||
image: "/img/component-images/banner/homepage-banner-img.png", | ||
}) | ||
}} | ||
{% endraw %} |
17 changes: 17 additions & 0 deletions
17
src/wmnds/patterns/banner/homepage-banner/_homepage-banner.njk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% macro wmndsHomepageBanner(params) %} | ||
{# Vars #} | ||
{% set image = params.image if params.image else "/img/component-images/banner/homepage-banner-img.png" %} | ||
{# Title #} | ||
{% set titleText = params.titleText if params.titleText else null %} | ||
{% set titleHTML = params.titleHTML if params.titleHTML else 'Bringing transport <br>together' %} | ||
{% set _title = titleText if titleText else titleHTML | safe %} | ||
|
||
<div class="wmnds-homepage-banner" style="background-image: url({{image}});"> | ||
<div class="wmnds-container"> | ||
<h1 class="wmnds-homepage-banner__title"> | ||
<span class="wmnds-homepage-banner__title-content">{{_title}}</span> | ||
</h1> | ||
</div> | ||
</div> | ||
|
||
{% endmacro %} |
21 changes: 21 additions & 0 deletions
21
src/wmnds/patterns/banner/homepage-banner/_homepage-banner.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.wmnds-homepage-banner { | ||
min-height: 325px; | ||
padding: $size-lg 0; | ||
background-repeat: no-repeat; | ||
background-position: 50% 50%; | ||
background-size: cover; | ||
|
||
&__title { | ||
@include type-setting(2); | ||
display: inline; | ||
color: $white; | ||
background-color: get-color(primary); | ||
box-shadow: 5px 0 0 5px get-color(primary), -5px 0 0 5px get-color(primary); | ||
} | ||
|
||
&__title-content { | ||
position: relative; // Fix background-color overlapping rows | ||
font-size: inherit; | ||
line-height: inherit; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/wmnds/patterns/banner/homepage-banner/_properties.njk.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"wmndsHomepageBannerProps": [ | ||
{ | ||
"name": "titleText", | ||
"type": "string", | ||
"description": "Title text to use in the banner." | ||
}, | ||
{ | ||
"name": "titleHTML", | ||
"type": "string", | ||
"description": "HTML title content to use in the banner. If <code class='wmnds-website-inline-code'>titleText</code> is provided, the <code class='wmnds-website-inline-code'>titleHTML</code> argument will be ignored." | ||
}, | ||
{ | ||
"name": "image", | ||
"type": "string", | ||
"description": "Url for the image to be displayed in the banner." | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters