diff --git a/core/profiles/demo_umami/demo_umami.info.yml b/core/profiles/demo_umami/demo_umami.info.yml index c1ca1838a90fe454109b78b1793045c281458135..8849ee6778e64e4ecf47285f5829b180d22bfd11 100644 --- a/core/profiles/demo_umami/demo_umami.info.yml +++ b/core/profiles/demo_umami/demo_umami.info.yml @@ -45,6 +45,7 @@ install: - locale - config_translation - content_translation + - sdc themes: - claro - umami diff --git a/core/profiles/demo_umami/themes/umami/components/disclaimer/disclaimer.component.yml b/core/profiles/demo_umami/themes/umami/components/disclaimer/disclaimer.component.yml new file mode 100644 index 0000000000000000000000000000000000000000..ea3ab4a1efdf2e9997219e1b23ad1b4062846906 --- /dev/null +++ b/core/profiles/demo_umami/themes/umami/components/disclaimer/disclaimer.component.yml @@ -0,0 +1,25 @@ +# This is so your IDE knows about the syntax for fixes and autocomplete. +$schema: https://git.drupalcode.org/project/sdc/-/raw/1.x/src/metadata.schema.json + +# The human readable name. +name: Disclaimer + +# Status can be: "experimental", "stable", "deprecated", "obsolete". +status: experimental + +# Schema for the props. We support www.json-schema.org. Learn more about the +# syntax there. +props: + # Props are always an object with keys. Each key is a variable in your + # component template. + type: object + + properties: + disclaimer: + type: string + description: Disclaimer text + copyright: + type: string + description: Copyright text of Disclaimer + examples: + - Terms & Conditions diff --git a/core/profiles/demo_umami/themes/umami/components/disclaimer/disclaimer.css b/core/profiles/demo_umami/themes/umami/components/disclaimer/disclaimer.css new file mode 100644 index 0000000000000000000000000000000000000000..78254d954dc798e1bf81fdb2092f3e5ec40cc789 --- /dev/null +++ b/core/profiles/demo_umami/themes/umami/components/disclaimer/disclaimer.css @@ -0,0 +1,38 @@ +/** + * @file + * This file is used to style the disclaimer block. + */ + +.disclaimer__disclaimer, +.disclaimer__copyright { + display: block; + text-align: center; + font-size: 0.94rem; +} + +@media screen and (min-width: 75rem) { + .disclaimer { + display: flex; + justify-content: space-between; + } + + .disclaimer__disclaimer, + .disclaimer__copyright { + margin-bottom: 0; + text-align: start; + } + + .disclaimer__disclaimer { + max-width: 40%; + margin-left: 0.5rem; /* LTR */ + } + + [dir="rtl"] .disclaimer__disclaimer { + margin-right: 0.5rem; + margin-left: 0; + } + + .disclaimer__copyright { + width: 25%; + } +} diff --git a/core/profiles/demo_umami/themes/umami/components/disclaimer/disclaimer.twig b/core/profiles/demo_umami/themes/umami/components/disclaimer/disclaimer.twig new file mode 100644 index 0000000000000000000000000000000000000000..61e91845d24ee4c03e9263c7147aa70acd9e24b5 --- /dev/null +++ b/core/profiles/demo_umami/themes/umami/components/disclaimer/disclaimer.twig @@ -0,0 +1,12 @@ +<div class="disclaimer"> + {% if disclaimer %} + <div class="disclaimer__disclaimer"> + {{ disclaimer }} + </div> + {% endif %} + {% if copyright %} + <div class="disclaimer__copyright"> + {{ copyright }} + </div> + {% endif %} +</div> diff --git a/core/profiles/demo_umami/themes/umami/css/components/blocks/disclaimer/disclaimer.css b/core/profiles/demo_umami/themes/umami/css/components/blocks/disclaimer/disclaimer.css deleted file mode 100644 index f1420da5ce23d4448895c236d8a11b1be196e7c6..0000000000000000000000000000000000000000 --- a/core/profiles/demo_umami/themes/umami/css/components/blocks/disclaimer/disclaimer.css +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @file - * This file is used to style the disclaimer block. - */ - -.block-type-disclaimer-block .field--name-field-disclaimer, -.block-type-disclaimer-block .field--name-field-copyright { - display: block; - text-align: center; - font-size: 0.94rem; -} - -@media screen and (min-width: 75rem) { - .block-type-disclaimer-block { - display: flex; - justify-content: space-between; - } - - .block-type-disclaimer-block .field--name-field-disclaimer, - .block-type-disclaimer-block .field--name-field-copyright { - margin-bottom: 0; - text-align: start; - } - - .block-type-disclaimer-block .field--name-field-disclaimer { - max-width: 40%; - margin-left: 0.5rem; /* LTR */ - } - - [dir="rtl"] .block-type-disclaimer-block .field--name-field-disclaimer { - margin-right: 0.5rem; - margin-left: 0; - } - - .block-type-disclaimer-block .field--name-field-copyright { - width: 25%; - } -} diff --git a/core/profiles/demo_umami/themes/umami/templates/components/disclaimer/block--bundle--disclaimer-block.html.twig b/core/profiles/demo_umami/themes/umami/templates/components/disclaimer/block--bundle--disclaimer-block.html.twig new file mode 100644 index 0000000000000000000000000000000000000000..8c7b9621fde6a1b12de0935f14fb10e9509b8c6e --- /dev/null +++ b/core/profiles/demo_umami/themes/umami/templates/components/disclaimer/block--bundle--disclaimer-block.html.twig @@ -0,0 +1,20 @@ +{% extends "block.html.twig" %} +{# +/** + * @file + * Theme override for a disclaimer block. + * + * Displays Umami Disclaimer and Copyright text. + * + * Available variables: + * - content.field_disclaimer: Content of Disclaimer formatted text field. + * - content.field_copyright: Content of Copyright formatted text field. + */ +#} +{% block content %} + {% embed 'umami:disclaimer' with { + disclaimer: content.field_disclaimer, + copyright: content.field_copyright, + } only %} + {% endembed %} +{% endblock %} diff --git a/core/profiles/demo_umami/themes/umami/umami.libraries.yml b/core/profiles/demo_umami/themes/umami/umami.libraries.yml index 8022393123998321989af592d234569e6b136e0a..b52151317d41eaf8ecae39d6833cb752b0442adc 100644 --- a/core/profiles/demo_umami/themes/umami/umami.libraries.yml +++ b/core/profiles/demo_umami/themes/umami/umami.libraries.yml @@ -6,7 +6,6 @@ global: component: css/components/blocks/banner/banner.css: {} css/components/blocks/branding/branding.css: {} - css/components/blocks/disclaimer/disclaimer.css: {} css/components/blocks/help/help.css: {} css/components/blocks/page-title/page-title.css: {} css/components/blocks/footer-promo/footer-promo.css: {}