diff --git a/assets/scss/custom/_unpublished.scss b/assets/scss/custom/_unpublished.scss new file mode 100644 index 0000000..59296e1 --- /dev/null +++ b/assets/scss/custom/_unpublished.scss @@ -0,0 +1,34 @@ +@mixin unpublished-page { + background-color: #fff4f4; + + &:before { + content: "- UNPUBLISHED -"; + display: block; + text-align: center; + font-size: 1.3333rem; + padding: 1rem 0; + margin: 0; + font-family: var(--bold-font-family); + font-weight: 300; + line-height: 1.3; + background-color: transparent; + } +} + +@mixin unpublished-component { + @include unpublished-page; + + &:before { + font-size: 1rem; + padding: .5rem 0; + line-height: 1; + } +} + +.node--unpublished { + @include unpublished-page; +} + +.paragraph--unpublished { + @include unpublished-component; +} diff --git a/templates/overrides/patterns/accordion_item/pattern-accordion-item.html.twig b/templates/overrides/patterns/accordion_item/pattern-accordion-item.html.twig new file mode 100644 index 0000000..61049f4 --- /dev/null +++ b/templates/overrides/patterns/accordion_item/pattern-accordion-item.html.twig @@ -0,0 +1,59 @@ +{% set entity = context.getProperty('entity') %} +{% set entity_type = context.getProperty('entity_type') %} + +{% set item_id = item_id|default("accordion-item-" ~ random()) %} + +{% set heading_level = heading_level|default(2) %} +{% +set button_attributes = create_attribute({ + 'class': [ + 'accordion-button', + 'collapsed' + ], + 'type': 'button', + 'data-bs-toggle': 'collapse', + 'data-bs-target': '#' ~ item_id, + 'aria-controls': item_id, + 'aria-expanded': 'false' +}) +%} + +{% +set content_attributes = create_attribute({ + 'id': item_id, + 'class': [ + 'accordion-collapse', + 'collapse', + 'js-accordion-keep-open' + ], + 'aria-labelledby': 'heading--' ~ item_id +}) +%} + +{% if opened %} + {% set button_attributes = button_attributes.setAttribute('aria-expanded', 'true') %} + {% set button_attributes = button_attributes.removeClass('collapsed') %} + {% set content_attributes = content_attributes.addClass('show') %} +{% endif %} + +{% + set classes = [ + 'accordion-item', + entity_type ? entity_type, + not entity.isPublished() ? entity_type ~ '--unpublished', + ] +%} + + + + + {{ title }} + + + +
+ {{ content }} +
+ + + diff --git a/templates/patterns/simple_card/pattern-simple-card.html.twig b/templates/patterns/simple_card/pattern-simple-card.html.twig index 5f376c1..052366c 100644 --- a/templates/patterns/simple_card/pattern-simple-card.html.twig +++ b/templates/patterns/simple_card/pattern-simple-card.html.twig @@ -1,8 +1,19 @@ +{% set entity = context.getProperty('entity') %} +{% set entity_type = context.getProperty('entity_type') %} + +{% + set classes = [ + 'card', + height ? 'h-100', + entity_type ? entity_type, + not entity.isPublished() ? entity_type ~ '--unpublished', + ] +%} + +{% set attributes = attributes.addClass('h-100') %} + {% if variant and variant|lower == 'horizontal' %} -{% if height %} - {% set attributes = attributes.addClass('h-100') %} -{% endif %} - +
{{ image|add_class('img-fluid rounded-start') }} @@ -29,10 +40,7 @@
{% else %} -{% if height %} - {% set attributes = attributes.addClass('h-100') %} -{% endif %} - + {% if image and image_position != 'bottom' %} {{ image|add_class('card-img-top') }} {% endif %}