Skip to content

[6.x] Fix widgets not rendering at their configured width - #15305

Open
jasonvarga wants to merge 4 commits into
6.xfrom
width-column-spans
Open

[6.x] Fix widgets not rendering at their configured width#15305
jasonvarga wants to merge 4 commits into
6.xfrom
width-column-spans

Conversation

@jasonvarga

Copy link
Copy Markdown
Member

Two dashboard widgets set to 50 don't sit side by side at wide viewports — they render a third wide, leaving a third of the row empty. Widths have been a hint rather than a contract.

Widgets each had their own four-step responsive ramp (sm/md/lg/full), which folded the six original percentages into four buckets, so 25 and 33 both became sm, and 50 and 66 both became md. Fields, meanwhile, already resolve their width to a span of a twelve column grid.

This drops the ramps and puts widgets on that same grid, with a single container query at 672px deciding whether the configured arrangement applies or everything stacks in order. 672px is where widgets already went from full to half width, so the point at which they first pair up is unchanged.

The width vocabulary is now shared by fields and widgets, and understands column spans of 112 alongside the percentages it already accepted. The percentages were always exact twelfths (25 → 3, 33 → 4, 50 → 6, 66 → 8, 75 → 9, 100 → 12), so everything that renders today renders identically. The sm/md/lg/full keywords stay widgets-only. Accepting spans on both surfaces at once matters: if only widgets took them, width: 6 would mean half a dashboard but a full width field.

The blueprint builder's width selector now fills and labels itself on resolved spans, so a hand-written width: 6 shows as half-filled and reads 50% rather than 6%.

field_width_class(), tailwind_width_class() and Str::tailwindWidthClass() are all uncalled by core now. They're deprecated but frozen exactly as they are — the two JS ones are public API regardless of who imports them, since every named export of globals.js is assigned onto window.

Upgrading

A blueprint or widget configured with width: 1 through width: 12 renders full width today and will now render as that many columns. This is only reachable if you'd typed a value that was never valid.

jasonvarga and others added 4 commits August 28, 2026 17:06
Move the width table out of publish.css into its own stylesheet, and let it
accept spans of 1-12 alongside the existing percentages and size keywords.
Every value maps to a span of the same twelve column grid the publish form
already uses. The percentages were always exact twelfths, so nothing that
renders today changes.

The rules are now unconditional, with the container query that collapses
everything to a single column moved onto the grid itself. That leaves each grid
free to pick its own collapse point while sharing one width vocabulary.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Widgets each had their own four step responsive ramp, so two widgets set to 50
rendered a third wide at large viewports and never sat side by side. Replace the
ramp with the same twelve column grid the publish form uses, and one container
query for the whole dashboard.

The threshold stays at 672px, where widgets already went from full to half
width, so the point at which they first pair up is unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Emit the configured width as a class and let the stylesheet resolve it, matching
what ui/Publish/Fields.vue already does. Without this a width of 6 would mean
half a dashboard but a full width field, silently, because .field-w-6 didn't
exist and the grid fell back to a full row.

The width selector compares on resolved spans, so a hand written span still
fills the right number of stops and reads back as a percentage rather than as
itself. Clicking a stop still writes the stop's own value.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
field_width_class(), tailwind_width_class() and Str::tailwindWidthClass() are
all uncalled by core now that the stylesheet resolves widths. The two JS ones
are public API regardless of who imports them, because index.js spreads every
named export of globals.js onto window, so freeze all three as they are rather
than teaching them about spans.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant