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
- Copy the gutenberg-block--uswds--card.html.twig from gutenberg_uswds/modules/gutenberg_uswds_card/templates to your front theme.
- Replace the library inside the gutenberg-block--uswds--card.html.twig in your theme:
{{ attach_library('your-theme/your-library') }} - Clear cache
- 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.
Issue fork gutenberg_uswds-3380573
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
Comment #3
jidrone commentedMerged PR and later I will add a link to a documentation page.