1613: Section Color: render One column through the shared layout organism - #512
Open
dblanken-yale wants to merge 1 commit into
Open
1613: Section Color: render One column through the shared layout organism#512dblanken-yale wants to merge 1 commit into
dblanken-yale wants to merge 1 commit into
Conversation
layout--onecol.html.twig now embeds @organisms/layout/layout with component__layout: 'one-column' instead of hand-rolling the yds-layout class and the data-component-theme attribute itself, so all four section layouts emit one signature from one template. layout--onecol is passed through as an extra class because core's stylesheets and both of the page's margin rules select on it. Because it always renders through the organism now, an unthemed section carries data-component-theme="default" where it previously carried no section markup at all. Two rules depend on that and are noted in the template: _yds-layout.scss excludes one-column from the default-theme section-margin rule, and ys_layouts/layouts/onecol/onecol.css scopes its vertical padding to a themed section, since yds-layout is no longer a themed-only signal. The "render nothing for an unthemed empty section" guard is unchanged. The post, event and page default displays each ship a trailing empty one-column Content Section, so rendering those would hand :last-of-type to an empty wrapper and drop the pre-footer margin on every node using them.
This was referenced Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1613: Section Color: Audit block contrast against the new One column / 70-30 section backgrounds
Description of work
Based on
1616-section-color-parity, notdevelop.This branch exists for two reasons, and the first one is the fix for the blocking finding on
yalesites-org/yalesites-project#1514.
Why the One column background did not render on the multidev
The review found that a One column section with a Component Theme rendered as a bare
<div class="layout layout--onecol">on the PR multidev, while the 70/30 section on the same pageworked. Neither of the suspected causes was it: the theme value is saved through the editor
form, and it does reach the template.
yalesites_profile/composer.jsonpinsyalesites-org/atomic: 1.82.0, and the One column themewiring exists only on the
1616-section-color-paritybranch of this repo — the released tags donot have it:
A Pantheon multidev only swaps in companion branches whose name matches the pushed branch, and
this repo had no
1613-block-contrast-section-backgroundsbranch, so the multidev built againstreleased atomic 1.82.0, whose onecol template emits no section markup at all. That also explains
the part of the evidence that pointed away from the real cause: both CSS rules the review found
are present, because
.layout--onecol.yds-layoutships fromys_layouts(on the PR branch) and.yds-layout[data-component-theme]has been in this theme'sdistfor a long time. CSS presentplus template absent is exactly the released-atomic combination.
So: this branch existing is the fix. It is an integration gap, not a code bug.
The change itself
layout--onecol.html.twignow embeds@organisms/layout/layoutwithcomponent__layout: 'one-column'rather than adopting theyds-layoutclass anddata-component-themeattribute by hand, so all four Layout Builder sections emit one signaturefrom one template:
layout--onecolis passed through as an extra class because core's stylesheets and both of thepage's margin rules (
.main-content > *:first-childinpage-layouts.scss,.main-content .layout.layout--onecol:last-of-typein this theme'slayout-builder.css) select onit.
What changes for an unthemed section. It now carries
data-component-theme="default"where itpreviously carried no section markup at all. That was the main risk and it was checked rather than
assumed: everything
--color-layout-borderfeeds — the CTA atom's fill, the divider atom, tabs,pull-quote — is already guarded on
[data-component-theme]:not([data-component-theme='default']), so an unthemed section picks upnone of it. Two supporting changes live in the companion PRs:
_yds-layout.scssexcludesone-columnfrom the default-theme section-margin rule, andonecol.cssscopes its verticalpadding to a themed section now that
yds-layoutis no longer a themed-only signal.The "render nothing for an unthemed empty section" guard is deliberately unchanged. The post,
event and page default displays each ship a trailing empty one-column Content Section, so rendering
those would hand
:last-of-typeto an empty wrapper and drop the pre-footer margin on every nodeusing them.
Functional testing steps:
1613-block-contrast-section-backgroundsin this repo,component-library-twigandyalesites-project(all based on1616-section-color-parity).npm run buildincomponent-library-twig, thenlando drush cr.lando drush php:script scripts/local/1613-section-contrast-fixture.php/1613-one-column-section-backgroundsand confirm all six backgrounds paint, and thateach section's markup carries both
data-component-themeanddata-component-layout="one-column".reports
data-component-theme="default".Builder, set a Component Theme, save, and confirm it paints.
Verification performed
inverted foreground:
onergb(0,54,107),tworgb(247,247,247),threergb(33,33,33),fourrgb(39,107,190),
fivergb(217,217,217),sixrgb(97,168,255).data-component-theme="default" data-component-layout="one-column".yds-layout layout,one-column, no__inner, no__primary, no__secondary, 0 dividers.1613: Section Color: Audit block contrast against the new One column / 70-30 section backgrounds component-library-twig#707 under
components/03-organisms/layout/layout/screenshots/.References yalesites-org/YaleSites-Internal#1613