From d7b6c19452e22c5260fbd8f8917b2fed40cec456 Mon Sep 17 00:00:00 2001 From: Ben Meyrick Date: Wed, 8 May 2019 10:27:33 +0100 Subject: [PATCH] 266 hub and spoke (#350) * Update summary to handle hub, and make icons simpler to positon * Fix wrapping of summary row title when theres an icon * Added hub example to summary page * Hub tweaks for mobile and created example of entire hub page --- src/components/breadcrumb/_breadcrumb.scss | 46 +++-- src/components/breadcrumb/_macro.njk | 2 +- src/components/button/_button.scss | 16 +- src/components/button/_macro.njk | 2 +- src/components/summary/_macro-options.md | 11 +- src/components/summary/_macro.njk | 16 +- src/components/summary/_summary.scss | 72 ++++++- src/components/summary/examples/hub/index.njk | 162 +++++++++++++++ .../examples/summary-household/index.njk | 3 +- src/components/summary/index.njk | 5 + src/img/icons/icons--external-link-hover.svg | 1 - src/img/icons/icons--external-link.svg | 10 +- src/img/icons/icons--lock.svg | 11 +- src/img/icons/icons--logo.svg | 1 - .../hub-and-spoke/examples/hub/index.njk | 192 ++++++++++++++++++ src/patterns/hub-and-spoke/index.njk | 11 + src/scss/base/_typography.scss | 4 +- src/scss/helpers/_mixins.scss | 101 +++------ src/scss/patternlib.scss | 5 +- src/styles/typography/icons/_icons.scss | 42 +--- .../spec/print-button/print-button.spec.js | 3 +- 21 files changed, 556 insertions(+), 160 deletions(-) create mode 100644 src/components/summary/examples/hub/index.njk delete mode 100644 src/img/icons/icons--external-link-hover.svg delete mode 100644 src/img/icons/icons--logo.svg create mode 100644 src/patterns/hub-and-spoke/examples/hub/index.njk create mode 100644 src/patterns/hub-and-spoke/index.njk diff --git a/src/components/breadcrumb/_breadcrumb.scss b/src/components/breadcrumb/_breadcrumb.scss index 9402fc5d11..877f7cc70e 100644 --- a/src/components/breadcrumb/_breadcrumb.scss +++ b/src/components/breadcrumb/_breadcrumb.scss @@ -1,28 +1,38 @@ +$breadcrumb-chevron-height: 0.65rem; + .breadcrumb { display: flex; align-items: center; padding: 1rem 0; -} -.breadcrumb__items { - margin: 0; - padding: 0; -} + &__items { + margin: 0; + padding: 0; + } -.breadcrumb__item { - display: inline-block; - margin: 0 0.4rem 0 0; - white-space: nowrap; /* stop items from wrapping, break on chevron only */ + &__item { + display: inline-block; + margin: 0; + white-space: nowrap; /* stop items from wrapping, break on chevron only */ - @include mq(xs, s) { - margin-bottom: 0.5rem; - } -} + &:not(:last-child):after { + @include icon('chevron-right', $breadcrumb-chevron-height, $breadcrumb-chevron-height); -.breadcrumb__item--current { - color: $color-text-light; -} + content: ''; + margin: 0 0.4rem; + vertical-align: middle; + } + + @include mq(xs, s) { + margin-bottom: 0.5rem; + } -.breadcrumb__link { - text-decoration: none; + &--current { + color: $color-text-light; + } + } + + &__link { + text-decoration: none; + } } diff --git a/src/components/breadcrumb/_macro.njk b/src/components/breadcrumb/_macro.njk index bf3bb686dc..fb34b541ff 100644 --- a/src/components/breadcrumb/_macro.njk +++ b/src/components/breadcrumb/_macro.njk @@ -2,7 +2,7 @@