Skip to content

fix: allow wide/full alignment inside content wrappers like .everlit-audio#2710

Open
adekbadek wants to merge 2 commits into
releasefrom
hotfix/wide-width-everlit-wrapper
Open

fix: allow wide/full alignment inside content wrappers like .everlit-audio#2710
adekbadek wants to merge 2 commits into
releasefrom
hotfix/wide-width-everlit-wrapper

Conversation

@adekbadek
Copy link
Copy Markdown
Member

@adekbadek adekbadek commented May 14, 2026

All Submissions:

Changes proposed in this Pull Request:

Hotfix for an interaction between the single-feature template's wide/full-alignment rules and plugins that wrap the_content at render time (Everlit's text-to-speech being the case we hit in the wild on inewsource.org).

The single-feature alignment rules in sass/blocks/_blocks.scss gate the negative-margin "escape" for .alignwide / .alignfull behind a direct-child selector:

.entry .entry-content > *,
.newspack-content-gate__inline-gate > *,
[id="pico"] > * {
  &.alignwide { /* margin-left: calc(25% - 25vw); etc. */ }
}

When Everlit is active, it injects a <span class="everlit-audio"> around the body of every post on the front end, so the alignwide <figure> is no longer a direct child of .entry-content and the rule no longer matches. The result is that wide-width images stay clamped to the column width on the front end – even though they render correctly in the editor, which doesn't run the filter.

This PR adds one selector to the existing allow-list: .entry .entry-content > .everlit-audio > *. It permits one level of wrapping for the known case without broadening to a generic descendant selector (which would incorrectly escape from nested blocks like columns / groups).

How to test the changes in this Pull Request:

  1. Activate the Everlit plugin (or any plugin that wraps the_content in a <span class="everlit-audio">). Locally I simulated it by adding a wp:html block opening <span class="everlit-audio everlit-no-audio"> at the top of a post and a closing </span> at the bottom.
  2. Create a post with template = single-feature.php and newspack_featured_image_position = above, behind, or beside (any single-featured-image position; beside matches the original report).
  3. Insert a wide-width image block in the body.
  4. View the published post on the front end at a viewport ≥ tablet.

Before: the figure width equals .entry-content width (~780px on a 1400px viewport, no negative-margin escape).
After: the figure width is ~1090px with margin: 0 -155px (escape via the existing alignwide rule). No horizontal scrollbar – the overflow: clip from #2667 still applies.

Tested locally with newspack-theme HEAD (v2.21.1 + this patch) using a single-feature + featured-image-beside post both with and without the span wrapper:

Wrapped in .everlit-audio Unwrapped (regression check)
Figure width 780 → 1090px 1090px (unchanged)
Figure margin 0 → 0 -155px 32px -155px (unchanged)
Horizontal scrollbar none none

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable? – CSS-only change; visual screenshots above stand in for tests.
  • Have you successfully ran tests with your changes locally?

Filed as a hotfix off release since publishers on Atomic are already affected. Forward-port to trunk to follow once this lands.

🤖 Generated with Claude Code

@adekbadek adekbadek requested a review from a team as a code owner May 14, 2026 12:56
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.21.2-hotfix-wide-width-everlit-wrapper.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

…audio

The single-feature template gates the negative-margin escape for .alignwide
and .alignfull behind a direct-child selector (`.entry-content > *`). When a
plugin wraps the_content at render time (e.g. Everlit injects a
`<span class="everlit-audio">` around the body for its text-to-speech
controls), that wrapper interposes itself between .entry-content and the
aligned block, the rule no longer matches, and wide-width images stay at
column width on the front end – even though they render correctly in the
editor, which doesn't run the filter.

Allow one level of wrapping for the known .everlit-audio case, matching the
existing pattern that already handles .newspack-content-gate__inline-gate
and #pico.

Reproduced locally on hotfix/wide-width-everlit-wrapper with a
single-feature + featured-image-beside post: with the span wrapper, figure
width 780px (= entry-content). With the patch, figure width 1090px and
margin -155px on each side, no horizontal-scrollbar regression from PR
#2667 (.site-content overflow:clip still applies).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@adekbadek adekbadek force-pushed the hotfix/wide-width-everlit-wrapper branch from 4340ee5 to d8515e2 Compare May 14, 2026 20:16
## [2.21.3-hotfix-wide-width-everlit-wrapper.1](v2.21.2...v2.21.3-hotfix-wide-width-everlit-wrapper.1) (2026-05-14)

### Bug Fixes

* allow wide/full alignment inside content wrappers like .everlit-audio ([d8515e2](d8515e2)), closes [#2667](#2667)
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.21.3-hotfix-wide-width-everlit-wrapper.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants