Provide a better way to override the components style.

Created on 10 August 2023, about 1 year ago

Problem/Motivation

Currently it is possible to override the style of the Gutenberg components provided by this module, by creating a template in your front theme and loading a different library from it.

But the library added there won't be loaded in the Gutenberd editor, which will make the editing experience inconsistent.

Steps to reproduce

  1. Copy the gutenberg-block--uswds--card.html.twig from gutenberg_uswds/modules/gutenberg_uswds_card/templates to your front theme.
  2. Replace the library inside the gutenberg-block--uswds--card.html.twig in your theme:{{ attach_library('your-theme/your-library') }}
  3. Clear cache
  4. Now the styles of the component will be different when you are seeing it in the front theme, but they will remain as the base USWDS styles in the Gutenberg editor.

Proposed resolution

Now that Drupal is introducing the SDC it would be great if the libraries loaded in the Gutenberg editor for a component can be taken from a Single Directory Component, so the styling experience would better for developers and the styles loaded will be consistent in the Gutenberg editor and the front theme.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇴Colombia jidrone

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024