The other half of https://www.drupal.org/project/uswds_paragraphs/issues/3046140

In summary, paragraphs theming should be in the uswds theme, not in the uswds_paragraphs module. That way, uswds_paragraphs is simply a provider of paragraph types, while uswds theme is in charge of how it looks.

CommentFileSizeAuthor
uswds-adopt_uswds_paragraph_theming.patch21.68 KBfskreuz

Comments

fskreuz created an issue. See original summary.

fskreuz’s picture

Irisibk’s picture

Assigned: Unassigned » Irisibk
jdearie’s picture

this worked great - I'm not actually using uswds_paragraphs, but i added the accordion paragraph bundle with the same fields names as that module and once i applied this patch to the theme my accordions rendered properly. Thx!

fskreuz’s picture

Title: Adopting uswds_paragraph theming » Move uswds_paragraph styles and templates to this theme
jdearie’s picture

If I want to use edge-to-edge settings, will i need to use uswds_paragraphs?

with all the different patches removing theming stuff, etc I'm a little confused on the steps i would need to take

i have a sub-theme of uswds 8.x-2.x
i'm not using uswds_paragraphs, but i am using the patch referenced here with some of my own paragraphs modeled after what was in uswds_paragraphs.

Should i install uswds_paragraphs and install:
https://www.drupal.org/project/uswds_paragraphs/issues/3046140 - to remove templates?

I'm using layout builder for styling, but the easiest way that I can think of to get the hero is using the hero uswds parapgraph with the edge-to-edge settings.

thx!

fskreuz’s picture

TL;DR:
- If you want to use edge-to-edge without using uswds_paragraphs, use the patch in this issue.
- If you also use uswds_paragraphs, also add the patch from the other issue.

Currently, edge-to-edge only works if a paragraph from uswds_paragraphs exists on the page (see _uswds_edge_to_edge_mode() and _uswds_current_entity_references_paragraphs() in the current code).

The patch in this issue removes that dependency. What edge-to-edge does after this patch is remove grid-container from the main section only, making pages page-wide globally instead of the default centered. You'll have to roll your own centering (i.e. use Panels, Layout Builder, etc.) if you want certain pages centered but have edge-to-edge enabled.

jdearie’s picture

@fskreuz - thanks for the quick explanation. seeing as how i'm not currently using uswds_paragraphs AND i'm already using the patch in this issue, i'll see if can get edge-to-edge to work w/o uswds_paragraphs.

thanks again!

brian.seek’s picture

I don't think that these templates for paragraphs should be included in this theme. I think the uswds paragraphs module needs to be able to update and develop independently of this theme. That will make that module much easier to maintain and add features to. It should be a module that people can use without this theme as a requirement because there are other USWDS themes and other ways to implement the design system. The module should be modular and not dependent on a theme.

Irisibk’s picture

Thanks for working on this @fskreuz!
I agree that this would probably be better if added to the USWDS Paragraphs module to keep both projects independent of each other. Even though both projects complement each other it would be nice to have paragraphs still display nicely for people that are already using a different theme.

Irisibk’s picture

Status: Needs review » Closed (won't fix)