Skip to content

Commit

Permalink
feat: add split dividers (resolves #328) (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
greatislander committed May 14, 2020
1 parent db4f000 commit ba390aa
Show file tree
Hide file tree
Showing 19 changed files with 118 additions and 11 deletions.
File renamed without changes.
67 changes: 67 additions & 0 deletions src/assets/styles/components/_responsive-blocks.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.blocks {
display: flex;
flex-direction: column;
}

.blocks__block + .blocks__block {
margin-top: $gutter;
}

.blocks__block--divider {
display: flex;
flex-direction: row;
flex-wrap: wrap;
font-family: $font-family-sans;
font-size: rem(18);
justify-content: center;
margin: 1rem 0;
position: relative;
width: 100%;

&::before {
border-bottom: solid rem(2);
content: "";
display: block;
position: absolute;
top: 0.75em;
width: 100%;
}
}

.blocks__block--divider span {
background-color: var(--parent-background-color, $white);
padding: 0 rem(12);
z-index: 1;
}

@include breakpoint-up(md) {
.blocks {
flex-direction: row;
}

.blocks__block + .blocks__block {
margin-left: $gutter;
margin-top: 0;
}

.blocks__block--divider {
display: block;
margin: 0 1.5rem;
width: auto;

&::before {
border-bottom: 0;
border-left: solid rem(2);
height: 100%;
left: 50%;
top: 0;
width: rem(2);
}
}

.blocks__block--divider span {
padding: rem(12) 0;
position: relative;
top: calc(50% - 1em);
}
}
1 change: 1 addition & 0 deletions src/assets/styles/pinecone.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
@import "components/menu";
@import "components/menu--home";
@import "components/menu-button";
@import "components/responsive-blocks";
@import "components/search";
@import "components/saved-search";
@import "layouts/header";
Expand Down
7 changes: 7 additions & 0 deletions src/components/atoms/_block-divider/block-divider.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
status: 'wip',
title: 'Block Divider',
context: {
text: 'or'
}
};
3 changes: 3 additions & 0 deletions src/components/atoms/_block-divider/block-divider.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="blocks__block--divider">
<span>{{ text }}</span>
</div>
2 changes: 1 addition & 1 deletion src/components/atoms/badge/badge.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
title: 'Badge',
status: 'wip',
order: 8,
order: 80,
context: {
label: 'Platform Cooperativism',
standAlone: false
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/button/button.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
title: 'Button',
status: 'wip',
order: 9,
order: 90,
context: {
label: 'Filter',
labelVisuallyHidden: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
title: 'Call to Action',
status: 'wip',
order: 6,
order: 60,
context: {
href: 'https://example.com/call-to-action',
label: 'Call to Action',
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/colors/colors.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
title: 'Colors',
status: 'ready',
order: 1,
order: 10,
context: {
colors: {
brand: [
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/divider/divider.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
status: 'ready',
title: 'Dividers',
order: 4,
order: 40,
context: {
dividers: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/form-elements/form-elements.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
title: 'Form Elements',
order: 10,
order: 100,
};
2 changes: 1 addition & 1 deletion src/components/atoms/icons/icons.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
title: 'Icons',
status: 'ready',
order: 2,
order: 20,
context: {
iconsTitle: 'Icons',
icons: [
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/image/image.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
title: 'Image',
status: 'wip',
order: 11,
order: 110,
context: {
src: '/images/person.jpg',
width: 367,
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/link/link.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
title: 'Link',
status: 'wip',
order: 5,
order: 50,
context: {
href: '/internal-link',
label: 'Link'
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/tag/tag.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
title: 'Tag',
status: 'wip',
order: 7,
order: 70,
context: {
label: 'Platform Cooperativism',
standAlone: false
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/typography/typography.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
title: 'Typography',
status: 'wip',
order: 3
order: 30
};
3 changes: 3 additions & 0 deletions src/components/molecules/responsive-blocks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Responsive Blocks

This molecule presents two blocks stacked on mobile and as columns on desktop, with an optional text divider.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
title: 'Responsive Blocks',
status: 'wip',
order: 17,
context: {
divider: true,
dividerText: 'or'
},
variants: [
{
name: 'Inverse',
label: 'Inverse',
context: {
modifier: 'inverse',
bodyClass: 'has-blue-500-background-color'
}
}
]
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="blocks{% if modifier %} blocks--{{ modifier }}{% endif %}">
<div class="blocks__block">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</div>
{% if divider %}
{% render '@block-divider', {text: dividerText}, true %}
{% endif %}
<div class="blocks__block">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</div>
</div>

0 comments on commit ba390aa

Please sign in to comment.