Skip to content

Conversation

@frederickobrien
Copy link
Contributor

@frederickobrien frederickobrien commented Jan 13, 2026

This updates Dotcom to expect and handle interactive atoms with a new fullWidth role, which allows them to go to the edges of the screen on all device sizes. This should cut down on DOM hacking and give interactive devs more time to focus on their stories.

Here you can see it in action:

image

I did go down a rabbit hole trying to make use of CSS Grid for this. The syntax is succinct and clear, though isn't compatible with the current interactive layouts. @JamieB-gu pointed me towards the grid module (see #4874, #11107), which might be a nice long-term change to look into.

Initial implementation here is just to get it working though very happy to tighten its scope (to just interactive atoms within interactive layouts, for example).

Something else to consider - does the ad insertion script need to be updated to handle the new role as well?

Note: hard code the role as 'fullWidth' around line 1,063 of renderElement.tsx for local testing

@frederickobrien frederickobrien self-assigned this Jan 13, 2026
@frederickobrien frederickobrien added the feature Departmental tracking: work on a new feature label Jan 13, 2026
@frederickobrien frederickobrien added this to the Visuals milestone Jan 13, 2026
@frederickobrien frederickobrien force-pushed the full-width-atoms branch 3 times, most recently from 21c039f to 0e86e05 Compare January 13, 2026 15:13
@github-actions
Copy link

github-actions bot commented Jan 13, 2026

@frederickobrien frederickobrien requested a review from a team January 16, 2026 16:07
@frederickobrien frederickobrien marked this pull request as ready for review January 16, 2026 16:08
@frederickobrien frederickobrien requested a review from a team as a code owner January 16, 2026 16:08
@github-actions
Copy link

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

@github-actions
Copy link

github-actions bot commented Jan 16, 2026

@frederickobrien frederickobrien marked this pull request as draft January 16, 2026 17:18
@frederickobrien frederickobrien marked this pull request as ready for review January 20, 2026 15:37
Copy link
Member

@JustinPinner JustinPinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me. It's constrained to the Figure, and has a specific use case, but I can't really comment on the CSS values so staying out of the way for someone closer to that to approve :)

@petternitter petternitter requested review from JamieB-gu and removed request for a team January 21, 2026 10:55
@frederickobrien frederickobrien added the run_chromatic Runs chromatic when label is applied label Jan 22, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 23, 2026
@frederickobrien
Copy link
Contributor Author

frederickobrien commented Jan 23, 2026

I'm off on Monday but would very much appreciate @guardian/dotcom-platform's two cents on the --scrollbar-width variable wrestled with in 5c956c5. This variable is set in interactive atoms using JavaScript, which I'd like to avoid if possible.

Essentially this:

scrollBarWidth = window.innerWidth - document.documentElement.clientWidth

A pure CSS version would be better. I'm sorely tempted to go down the rabbit hole of #15165 - which I think would lead to cleaner, more platform-aligned CSS in the long term - though that's beyond the scope of this PR and shouldn't stand in its way.

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

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants