Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: divider style #135

Merged
merged 1 commit into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/wmcads/components/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@import "content-card/content-card"; // content cards
@import "content-tiles/content-tiles"; // Content tiles for major works pages
@import "details/details"; // details
@import "divider/divider"; // divider
@import "document/document"; // document
@import "file-download/file-download"; // File download
@import "form-elements/form-elements"; // Form elements
Expand Down
6 changes: 6 additions & 0 deletions src/wmcads/components/divider/_divider.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% macro wmcadsDivider(params) %}
{% set class = " " + params.class if params.class else "wmcads-divider-primary" %}

<hr{% if(params.class) %} class="wmcads-divider-{{params.class}}"{% endif %} aria-hidden="true">

{% endmacro %}
29 changes: 29 additions & 0 deletions src/wmcads/components/divider/_divider.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
hr,
.wmcads-divider {
border: 3px solid get-color(primary);

&-primary {
border-color: get-color(primary);
}

&-grey {
border-color: get-color(brandCoolGrey);
}

&-wmgreen {
border-color: get-color(brandWmGreen);
}

&-wmred {
border-color: get-color(brandWmRed);
}

&-wmpurple {
border-color: get-color(brandWmPurple);
}

&-wmblue {
border-color: get-color(brandWmBlue);
}

}
9 changes: 6 additions & 3 deletions src/www/assets/json/merged.njk.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@
{
"name": "Content card"
},
{
"name": "Document"
},
{
"name": "Details"
},
{
"name": "Document"
},
{
"name": "Divider"
},
{
"name": "File download"
},
Expand Down
67 changes: 67 additions & 0 deletions src/www/pages/components/divider/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{% extends "www/_layouts/layout-left-pane.njk" %}
{% set pageTitle="Divider" %}
{% from "wmcads/components/divider/_divider.njk" import wmcadsDivider %}
{% from "www/_partials/component-example/component-example.njk" import compExample %}

{% block content %}
<h2>Default divider</h2>
{{
compExample([
wmcadsDivider()
])
}}

<h2>Primary divider</h2>
{{
compExample([
wmcadsDivider({
class: 'primary'
})
])
}}

<h2>Cool Grey divider</h2>
{{
compExample([
wmcadsDivider({
class: 'grey'
})
])
}}

<h2>WM Green divider</h2>
{{
compExample([
wmcadsDivider({
class: 'wmgreen'
})
])
}}

<h2>WM Red divider</h2>
{{
compExample([
wmcadsDivider({
class: 'wmred'
})
])
}}

<h2>WM Purple divider</h2>
{{
compExample([
wmcadsDivider({
class: 'wmpurple'
})
])
}}

<h2>WM Blue divider</h2>
{{
compExample([
wmcadsDivider({
class: 'wmblue'
})
])
}}
{% endblock %}