From 12506cb4d082d1c4f0ee4bfbaf53f6341df832c7 Mon Sep 17 00:00:00 2001 From: Precious Onyenaucheya Date: Thu, 19 Dec 2024 13:12:45 +0000 Subject: [PATCH] update as per PR comments --- src/components/hero/_hero.scss | 32 +++++++++++-- src/components/hero/_macro-options.md | 27 +++++------ src/components/hero/_macro.njk | 46 ++++++++++--------- src/components/hero/_macro.spec.js | 22 +++++++-- ...ero-analysis.njk => example-hero-grey.njk} | 5 +- 5 files changed, 86 insertions(+), 46 deletions(-) rename src/components/hero/{example-hero-analysis.njk => example-hero-grey.njk} (96%) diff --git a/src/components/hero/_hero.scss b/src/components/hero/_hero.scss index 9e03008c2d..f2735f17c6 100644 --- a/src/components/hero/_hero.scss +++ b/src/components/hero/_hero.scss @@ -28,12 +28,32 @@ } } - &--analysis { - background-color: var(--ons-color-banner-bg); + &--grey { + background-color: #efeff0; + &::before { + content: ''; + background-color: var(--ons-color-banner-bg); + border-radius: 0 0 50% 50%; + inset: 0; + left: -40%; + position: absolute; + width: 150%; + @include mq(l) { + border-radius: 0 0 300% 150%; + left: 0; + width: 100%; + } + } + } + &__badge { + @include mq(xs) { + margin-top: 2.5rem; + margin-bottom: 1rem; + } } &--topic { - color: var(--ons-color-branded) !important; + color: var(--ons-color-branded); } &__container { @@ -306,10 +326,14 @@ &__title-container { @include mq(l) { - display: flex; + display: grid; align-items: start; justify-content: space-between; gap: 1rem; + + &.ons-hero__title-badge { + grid-template-columns: 1fr auto; + } } } } diff --git a/src/components/hero/_macro-options.md b/src/components/hero/_macro-options.md index 619bb96a1b..1e5cca03f7 100644 --- a/src/components/hero/_macro-options.md +++ b/src/components/hero/_macro-options.md @@ -1,16 +1,17 @@ -| Name | Type | Required | Description | -| --------------- | --------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- | -| variants | array or string | false | An array of values or single value (string) to adjust the component using available variant, “dark, navy-blue and analysis” | -| wide | boolean | false | Set to “true” when using the `wide` page layout container | -| topic | string | false | Topic for the hero | -| title | string | true | Text for the hero title | -| subtitle | string | false | Text for the hero subtitle | -| text | string | false | Text to follow the hero title and subtitle | -| button | `Object