diff --git a/assets/src/blocks/TakeActionBoxout/TakeActionBoxoutEditor.js b/assets/src/blocks/TakeActionBoxout/TakeActionBoxoutEditor.js index 93766499e7..e8df33056b 100644 --- a/assets/src/blocks/TakeActionBoxout/TakeActionBoxoutEditor.js +++ b/assets/src/blocks/TakeActionBoxout/TakeActionBoxoutEditor.js @@ -167,17 +167,17 @@ export const TakeActionBoxoutEditor = ({ withoutInteractiveFormatting allowedFormats={['core/bold', 'core/italic']} /> + - ); diff --git a/assets/src/blocks/TakeActionBoxout/TakeActionBoxoutFrontend.js b/assets/src/blocks/TakeActionBoxout/TakeActionBoxoutFrontend.js index 16eb5413ee..e9b4642b02 100644 --- a/assets/src/blocks/TakeActionBoxout/TakeActionBoxoutFrontend.js +++ b/assets/src/blocks/TakeActionBoxout/TakeActionBoxoutFrontend.js @@ -22,7 +22,7 @@ export const TakeActionBoxoutFrontend = ({ href={link} {...newTab && {rel: 'noreferrer', target: '_blank'}} /> - {imageAlt} + {imageUrl ? {imageAlt} :
}
{title && } + {link && linkText && + + {linkText} + + }
- {link && linkText && - - {linkText} - - } ); diff --git a/assets/src/scss/blocks/TakeActionBoxout/TakeActionBoxoutEditorStyle.scss b/assets/src/scss/blocks/TakeActionBoxout/TakeActionBoxoutEditorStyle.scss index 6bcd70b9d9..85a0f0c1e8 100644 --- a/assets/src/scss/blocks/TakeActionBoxout/TakeActionBoxoutEditorStyle.scss +++ b/assets/src/scss/blocks/TakeActionBoxout/TakeActionBoxoutEditorStyle.scss @@ -20,8 +20,7 @@ .boxout-image-container { position: relative; background: var(--grey-500); - height: 100%; - width: 336px; + width: 50%; padding: 0; display: flex; align-items: center; diff --git a/assets/src/scss/blocks/TakeActionBoxout/TakeActionBoxoutStyle.scss b/assets/src/scss/blocks/TakeActionBoxout/TakeActionBoxoutStyle.scss index e3051af050..0841635816 100644 --- a/assets/src/scss/blocks/TakeActionBoxout/TakeActionBoxoutStyle.scss +++ b/assets/src/scss/blocks/TakeActionBoxout/TakeActionBoxoutStyle.scss @@ -1,14 +1,49 @@ +@mixin boxout-half-and-half { + height: 222px; + + .boxout-content { + width: 50%; + padding: 0 $sp-4; + margin: auto; + } + + .btn { + margin-top: $sp-3; + width: 100%; + } + + img, + .boxout-placeholder { + width: 50%; + border-top-left-radius: $sp-x; + border-bottom-left-radius: $sp-x; + + html[dir="rtl"] & { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + border-top-right-radius: $sp-x; + border-bottom-right-radius: $sp-x; + } + } +} + .boxout { background: var(--white); - padding: $sp-2; width: 100%; - height: 128px; display: flex; box-shadow: 0 1px 8px rgba(0, 0, 0, 0.16); transition: box-shadow 0.2s; border-radius: 4px; position: relative; + .not-now { + display: none; + } + + .boxout-placeholder { + background-color: var(--grey-100); + } + .cover-card-overlay { position: absolute; left: 0; @@ -23,29 +58,15 @@ .boxout-heading { text-decoration: underline; } - - .btn { - background-color: var(--button-primary--hover--background); - } - } - - .not-now { - display: none; } - img { - width: 96px; - min-width: 96px; + img, + .boxout-placeholder { height: 100%; pointer-events: none; object-fit: cover; } - .boxout-content { - padding: $sp-1; - flex: auto; - } - &::before, &::after { display: none; @@ -56,10 +77,10 @@ font-family: var(--font-family-heading); font-size: var(--font-size-m--font-family-primary); font-weight: var(--font-weight-regular); - line-height: var(--line-height-l--font-family-primary); color: var(--color-text-body); } - margin-bottom: 0; + + margin-bottom: $sp-1; display: -webkit-box; line-clamp: 2; -webkit-line-clamp: 2; @@ -70,138 +91,122 @@ .btn { _-- { - font-size: 12px; + font-size: var(--font-size-xxxs--font-family-primary); line-height: 2.5; } - white-space: nowrap; - position: absolute; - bottom: $sp-2; - right: $sp-2; - html[dir="rtl"] & { - right: auto; - left: $sp-2; - } + white-space: nowrap; } .boxout-excerpt { - display: none; + _-- { + font-family: var(--font-family-paragraph-secondary); + font-size: var(--font-size-s--font-family-tertiary); + line-height: var(--line-height-m--font-family-tertiary); + } + + color: var(--color-text-body); + display: -webkit-box; + line-clamp: 2; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; + margin: 0; } - @include medium-and-up { - .boxout-heading { - margin-bottom: $sp-1; - font-size: var(--font-size-m--font-family-primary); - } + &:not(.sticky-bottom-mobile) { + @include small-and-less { + margin-bottom: $sp-3; + flex-direction: column-reverse; - .boxout-excerpt { - _-- { - font-family: var(--font-family-paragraph-secondary); - font-size: var(--font-size-xs--font-family-tertiary); - line-height: var(--line-height-m--font-family-tertiary); + .boxout-content { + padding: $sp-4; } - color: var(--color-text-body); - display: -webkit-box; - line-clamp: 1; - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; - overflow: hidden; - margin: 0; - } - .btn { - _-- { - font-size: 15px; + .btn { + margin-top: $sp-3; + width: 100%; } - align-self: flex-end; - position: unset; - } - } - - @include large-and-up { - height: 210px; - padding: 0; - - img { - min-width: 336px; - border-top-left-radius: $sp-x; - border-bottom-left-radius: $sp-x; - html[dir="rtl"] & { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - border-top-right-radius: $sp-x; + img, + .boxout-placeholder { + height: 198px; border-bottom-right-radius: $sp-x; + border-bottom-left-radius: $sp-x; } } - .boxout-content { - padding: $sp-3; - } - - .boxout-excerpt { - line-clamp: 3; - -webkit-line-clamp: 3; + @include medium-and-up { + @include boxout-half-and-half; } + } - .btn { - position: absolute; - right: $sp-3; - bottom: $sp-3; - - html[dir="rtl"] & { - right: auto; - left: $sp-3; + &.sticky-bottom-mobile { + @include medium-and-less { + z-index: 9999; + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: 128px; + border-radius: 0; + transition: all 0.5s; + padding: $sp-2; + + img, + .boxout-placeholder { + width: 96px; + height: 96px; } - } - } -} -@media screen and (max-width: $large-width) { - .sticky-bottom-mobile { - z-index: 9999; - position: fixed; - bottom: 0; - left: 0; - right: 0; - height: 128px; - border-radius: 0; - transition: all 0.5s; + .boxout-content { + padding-inline-start: $sp-2; + padding-top: $sp-1; + } - .boxout-heading { - margin-inline-end: $sp-3; - } + .cover-card-overlay, + .boxout-excerpt { + display: none; + } - .cover-card-overlay, - .boxout-excerpt { - display: none; - } + .btn { + position: absolute; + right: $sp-2; + bottom: $sp-2; - .not-now { - display: block; - background: url("../../public/images/close-boxout.svg"); - background-position: bottom right; - background-size: cover; - position: absolute; - width: 16px; - height: 16px; - top: $sp-2; - right: $sp-2; - - html[dir="rtl"] & { - right: auto; - left: $sp-2; + html[dir="rtl"] & { + right: auto; + left: $sp-2; + } } - } - @include medium-and-up { - .boxout-content { - padding-top: $sp-2; + .not-now { + display: block; + background: url("../../images/close-boxout.svg"); + background-position: bottom right; + background-size: cover; + position: absolute; + width: 16px; + height: 16px; + top: $sp-2; + right: $sp-2; + + html[dir="rtl"] & { + right: auto; + left: $sp-2; + } } - .boxout-heading { - margin-inline-end: 0; + @include mobile-only { + .boxout-heading { + margin-inline-end: $sp-3; + font-size: var(--font-size-xxs--font-family-primary); + } } } + + @include large-and-up { + @include boxout-half-and-half; + } } } diff --git a/images/close-boxout.svg b/images/close-boxout.svg new file mode 100644 index 0000000000..500872487c --- /dev/null +++ b/images/close-boxout.svg @@ -0,0 +1,3 @@ + + + diff --git a/templates/blocks/take-action-boxout.twig b/templates/blocks/take-action-boxout.twig index f7c94cc0bf..f057510ad8 100644 --- a/templates/blocks/take-action-boxout.twig +++ b/templates/blocks/take-action-boxout.twig @@ -18,6 +18,8 @@ sizes="(min-width: 1000px) 358px, (min-width: 780px) 313px, 88px" alt="{{ boxout.image_alt }}" title="{{ boxout.image_alt }}" /> + {% else %} +
{% endif %}
{% if ( boxout.title ) %} @@ -35,19 +37,19 @@ {% if ( boxout.excerpt ) %}

{{ boxout.excerpt|e('wp_kses_post')|raw }}

{% endif %} + {% if ( boxout.link and boxout.link_text ) %} + + {{ boxout.link_text }} + + {% endif %}
- {% if ( boxout.link and boxout.link_text ) %} - - {{ boxout.link_text }} - - {% endif %} {% if boxout.stickyMobile %}