Skip to content
Snippets Groups Projects
Verified Commit ff392533 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3365497 by finnsky, Gauravvvv, sarahjean, smustgrave, snig, e0ipso,...

Issue #3365497 by finnsky, Gauravvvv, sarahjean, smustgrave, snig, e0ipso, pdureau: Create new SDC component for Umami Banner
parent 8e3e867b
No related branches found
No related tags found
30 merge requests!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!9470[10.3.x-only-DO-NOT-MERGE]: #3331771 Fix file_get_contents(): Passing null to parameter,!8540Issue #3457061: Bootstrap Modal dialog Not closing after 10.3.0 Update,!8528Issue #3456871 by Tim Bozeman: Support NULL services,!8373Issue #3427374 by danflanagan8, Vighneshh: taxonomy_tid ViewsArgumentDefault...,!7526Expose roles in response,!7352Draft: Resolve #3203489 "Set filename as",!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3668Resolve #3347842 "Deprecate the trusted",!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2794Issue #3100732: Allow specifying `meta` data on JSON:API objects,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2334Issue #3228209: Add hasRole() method to AccountInterface,!2062Issue #3246454: Add weekly granularity to views date sort,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #107380 passed with warnings
Pipeline: drupal

#107393

    Pipeline: drupal

    #107384

      # This is so your IDE knows about the syntax for fixes and autocomplete.
      $schema: https://git.drupalcode.org/project/drupal/-/raw/10.1.x/core/modules/sdc/src/metadata.schema.json
      # The human readable name.
      name: Banner
      # Status can be: "experimental", "stable", "deprecated", "obsolete".
      status: experimental
      props:
      # Props are always an object with keys. Each key is a variable in your
      # component template.
      type: object
      properties:
      attributes:
      type: Drupal\Core\Template\Attribute
      title: Attributes
      description: Banner attributes.
      # Slots always hold arbitrary markup. We know that beforehand, so no need for
      # a schema for slots.
      slots:
      # The key is the name of the slot. In your template you will use
      # {% block content %}.
      content:
      # A human-readable name.
      title: Content
      # A description.
      description: This is the banner content
      image:
      # A human-readable name.
      title: Image
      # A description.
      description: This is the banner image
      ......@@ -3,12 +3,12 @@
      * This file is used to style the banner block.
      */
      .banner-block__content {
      .banner__content {
      margin: 1rem 4%;
      font-size: 1.188em;
      }
      .banner-block .field--name-field-title {
      .banner__title {
      margin: 0 0 0.5em 0;
      font-family: "Scope One", Georgia, serif;
      font-size: 1.777em;
      ......@@ -16,38 +16,14 @@
      line-height: 1.2em;
      }
      .banner-block .field--name-field-content-link a {
      display: inline-block;
      padding: 0.7em 1.3em;
      cursor: pointer;
      transition: background-color 0.5s ease;
      text-align: center;
      text-decoration: none;
      color: #fff;
      border: 2px solid #d93760;
      border-radius: 3px;
      background-color: #d93760;
      font-family: "Scope One", Georgia, serif;
      font-size: 1.2rem;
      font-weight: 400;
      }
      .banner-block .field--name-field-content-link a:focus,
      .banner-block .field--name-field-content-link a:hover {
      color: #000;
      border-color: #d93760;
      outline-color: #fff;
      outline-offset: 2px;
      background-color: #fcece7;
      }
      /* Medium */
      @media screen and (min-width: 48rem) { /* 768px */
      .banner-block {
      .banner {
      position: relative; /* Anchor absolutely positioned background image. */
      background-color: #464646;
      }
      .banner-block__inner {
      .banner__inner {
      display: flex;
      align-items: center;
      min-height: 54vw;
      ......@@ -55,7 +31,7 @@
      padding: 0 4%;
      }
      .banner-block__content {
      .banner__content {
      position: relative; /* Establish stacking context to appear above absolutely positioned background image. */
      max-width: 50%;
      margin: 0;
      ......@@ -65,7 +41,7 @@
      background: rgba(0, 0, 0, 0.42);
      }
      .banner-block__image img {
      .banner__image img {
      position: absolute;
      top: 0;
      left: 0;
      ......@@ -76,16 +52,16 @@
      }
      /* Large */
      @media screen and (min-width: 60rem) { /* 960px */
      .banner-block__content {
      .banner__content {
      max-width: 41%;
      }
      .banner-block__inner {
      .banner__inner {
      min-height: 43vw;
      }
      }
      /* Extra large + side margins */
      @media screen and (min-width: 80rem) { /* 1200px (large) + 80px (side margins) = 1280px */
      .banner-block__inner {
      .banner__inner {
      padding: 0;
      }
      }
      <div{{ attributes.addClass('banner') }}>
      <div class="container">
      <div class="banner__inner">
      <div class="banner__image">
      {% block image %}{% endblock %}
      </div>
      <div class="banner__content">
      {% block content %}{% endblock %}
      </div>
      </div>
      </div>
      </div>
      ......@@ -30,6 +30,19 @@
      background-color: #e6eee0;
      }
      .button--primary {
      border-color: #d93760;
      background-color: #d93760;
      }
      .button--primary:hover,
      .button--primary:active,
      .button--primary:focus {
      outline-color: #fff;
      outline-offset: 2px;
      background-color: #fcece7;
      }
      .button[disabled]:hover,
      .button[disabled]:active,
      .button[disabled]:focus,
      ......
      {% extends "block.html.twig" %}
      {#
      /**
      * @file
      ......@@ -26,31 +27,19 @@
      * @see template_preprocess_block()
      */
      #}
      {%
      set classes = [
      'banner-block',
      'block',
      'block-' ~ configuration.provider|clean_class,
      'block-' ~ plugin_id|clean_class,
      ]
      %}
      <div{{ attributes.addClass(classes) }}>
      <div class="container">
      <div class="banner-block__inner">
      {{ title_prefix }}
      {% if label %}
      <h2{{ title_attributes }}>{{ label }}</h2>
      {% endif %}
      {{ title_suffix }}
      {% block content %}
      <div class="banner-block__image">
      {{ content.field_media_image }}
      </div>
      <div class="banner-block__content">
      {{ content|without('field_media_image') }}
      </div>
      {% endblock %}
      </div>
      </div>
      </div>
      {% block content %}
      {% embed 'umami:banner' with {
      attributes: create_attribute(),
      } %}
      {% block image %}
      {{ content.field_media_image }}
      {% endblock %}
      {% block content %}
      {% include "umami:title" with {
      attributes: create_attribute({'class': ['banner__title']}),
      label: content.field_title,
      } only %}
      {{ content|without(['field_media_image', 'field_title']) }}
      {% endblock %}
      {% endembed %}
      {% endblock %}
      ......@@ -4,7 +4,6 @@ global:
      base:
      css/base.css: {}
      component:
      css/components/blocks/banner/banner.css: {}
      css/components/blocks/help/help.css: {}
      css/components/blocks/page-title/page-title.css: {}
      css/components/blocks/language-switcher/language-switcher.css: {}
      ......
      ......@@ -69,6 +69,19 @@ function umami_theme_suggestions_block_alter(array &$suggestions, array $variabl
      }
      }
      /**
      * Implements hook_umami_preprocess_block__bundle__banner_block().
      */
      function umami_preprocess_block__bundle__banner_block(&$variables) {
      if (isset($variables['content']['field_content_link'])) {
      foreach (Element::children($variables['content']['field_content_link']) as $key) {
      $variables['content']['field_content_link'][$key]['#attributes']['class'][] = 'button';
      $variables['content']['field_content_link'][$key]['#attributes']['class'][] = 'button--primary';
      $variables['content']['field_content_link'][$key]['#attributes']['class'][] = 'banner__button';
      }
      }
      }
      /**
      * Implements hook_umami_preprocess_block__bundle__footer_promo_block().
      */
      ......
      0% Loading or .
      You are about to add 0 people to the discussion. Proceed with caution.
      Finish editing this message first!
      Please register or to comment