diff --git a/CHANGELOG.md b/CHANGELOG.md index 399dc0ca..15470933 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,8 @@ Introducing theme variables! CSS variables beginning with `--theme-` will adjust ### Split +* Split can now be nested inside content containers with the `mzp-l-split-nested` class +* (breaking) Removed `overflow-x: hidden` from component (#1089) * (breaking) Removed `mzp-l-split-pop-top`, `mzp-l-split-pop-bottom`, and `mzp-l-split-pop` layout classes from Split component * (breaking) Removed `mzp-l-split-media-overflow` and `mzp-l-split-media-constrain-height` layout classes from Split component diff --git a/assets/sass/protocol/components/_split.scss b/assets/sass/protocol/components/_split.scss index 0412dbfa..cdac8644 100644 --- a/assets/sass/protocol/components/_split.scss +++ b/assets/sass/protocol/components/_split.scss @@ -8,7 +8,6 @@ // Basic vertical alignment .mzp-c-split { - overflow-x: hidden; position: relative; padding: var(--theme-spacing-between-block) 0; @@ -37,6 +36,13 @@ .mzp-t-content-xl & { max-width: $content-xl; } + + // Allow split to be nested inside another container (e.g. mzp-l-content) + .mzp-l-split-nested & { + max-width: none; + padding-left: 0; + padding-right: 0; + } } .mzp-c-split-body { diff --git a/components/split/readme.md b/components/split/readme.md index 74296bb8..a2834537 100644 --- a/components/split/readme.md +++ b/components/split/readme.md @@ -49,10 +49,13 @@ variations. - `mzp-l-split-center-on-sm-md` - content is centered on small to medium screens. - `mzp-l-split-hide-media-on-sm-md` - media is hidden on small to medium screens. -### No-nos: +### Nesting inside a container -**Note:** This component is intended to be a full-width section of a page, with -an outer container that spans the width of the viewport and generous spacing -above and below. Split has an inner container to define its content width, so -don't place Split inside another `mzp-l-content` [container](content-container). -The nested spacing will get weird. +By default, Split is intended to be a full-width section of a page, with an +outer container that spans the width of the viewport. Split has its own inner +container to define its content width. + +If you need to nest Split inside another container (e.g. `mzp-l-content`), add +the `mzp-l-split-nested` class to the outermost element (`mzp-c-split`). This +removes the inner container's max-width and padding so it fills the parent +container without doubling up on spacing. diff --git a/components/split/split--nested.html b/components/split/split--nested.html new file mode 100644 index 00000000..ec541800 --- /dev/null +++ b/components/split/split--nested.html @@ -0,0 +1,33 @@ +{# @split--nested +# +# parameters: +# block_class - string +# background_class - string +# body_class - string +# content - string, markup +# image - path +#} +
Lorem ipsum dolor sit amet, amet dolores tincidunt te sea. His aliquid epicuri detraxit in, cum tantas populo periculis te. Ei vix idque noster.
+{% render '@button', { link: '#', label: 'Call to action' } %}
+ {% endif %} +
+ {%- endif -%}
+