feat: allow parent to dictate position when it has the position class#409
feat: allow parent to dictate position when it has the position class#409thomasguillot wants to merge 5 commits intotrunkfrom
Conversation
laurelfulford
left a comment
There was a problem hiding this comment.
This works well on the front-end, @thomasguillot, but I get some weirdness in the editor:
When I add overlay-contents--position--right to the mobile menu template part -- this:
The menu toggle moves to the right just in the editor:

And when I add overlay-contents--position--full-width, it gets some extra spacing:
Both work as described on the front-end, though, and I don't see any issues with the search.
These are both with Mobile pattern 2, but I saw the same thing with 1 (haven't tested 3). Am I just screwing up where to add the class? I checked the Mobile Menu Contents template part and there's not a parent container wrapping everything.
|
@laurelfulford I think it's because of the CSS (e.g. So no CSS is applied in the editor. And the front-end still works. Let me know your thoughts. |
All Submissions:
Changes proposed in this Pull Request:
This PR adds support for parent containers to
--forcean overlay’s position.Specifically, when overlay content is included via a template part, such as the mobile menu, the parent template part wrapper can define a position class like
overlay-contents--position--right--force. This overrides the position set within the overlay itself, allowing patterns to control the slide direction without modifying the shared template part.This allows us to have multiple patterns (e.g. header) but still make sure the overlay comes from the correct side of the screen based on how buttons are organised.
How to test the changes in this Pull Request:
Note: Small screen is probably the easiest way to test so resize your screen
parts/mobile-menu.htmloverlay-contents--position--right--forceto themobile-menupart, save--ful-width--forcetooOther information: