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', + ] +%} + +