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.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jidrone created an issue. See original summary.

jidrone’s picture

Status: Active » Fixed

Merged PR and later I will add a link to a documentation page.

  • jidrone committed 66dbcd8c on 1.0.x
    Issue #3380573: Provide a better way to override the components style
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.