feat: apply labels aside to form layout field children - #12601
Draft
vursen wants to merge 38 commits into
Draft
Conversation
vursen
force-pushed
the
feat/form-layout-label-aside-fields
branch
from
September 3, 2026 09:52
3c37dc3 to
fec5d00
Compare
Member
|
Why |
Contributor
Author
Labels-aside is already used to mean simply that the mode is enabled. So maybe labels-aside-active would be better off as labels-fit-aside or something along those lines instead. |
Member
|
|
vursen
force-pushed
the
feat/form-layout-label-aside-fields
branch
2 times, most recently
from
September 7, 2026 08:15
597b8b7 to
ebc6f66
Compare
The baseline guide now always uses the bottom-anchored configuration: its area ends at the input's top line and the negative margin pulls it down over the input box, which works no matter what is displayed above the input. This removes the has-label / no-label toggle properties, whose only consumer was the guide, and fixes the baseline of a field with a helper above and no label, which was reported at the helper's text line instead of the input's. The slider controls now get the input border and padding also without a label; this height previously came from the guide's size in the no-label configuration. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Message-input set --vaadin-input-field-border-width to a unitless 0, which made the baseline guide's margin calc invalid. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The shared guide now anchors to the first row unconditionally, so the variant no longer needs its own grid-row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Without a label the label column width and spacing default to 0. Explicit --vaadin-field-label-width and --vaadin-field-label-spacing still apply, so a form layout can keep the column to align fields. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Rename the label-aside properties to --vaadin-field-side-label-width and --vaadin-field-side-label-gap. Their defaults (auto, 1em) apply only when the field has a label; without one both fall back to 0, while explicit values still apply so a form layout can keep the column. The shared label rule uses width: min-content so long labels don't widen the field. In its own column that collapses the label to one character, so label-aside sets width: auto on the label. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Replaces the unit test with screenshots of the empty and selected states, where the label must sit at the same height. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The em-space keeps a text baseline in the empty value button so the label doesn't move when a value is set in the label-aside variant. The value button is the box without text, so it carries the rule itself, like the Lumo button does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The field templates take extra rows after the input from --_rows-after-input, empty by default, so the slider no longer duplicates the label-above and label-aside templates for its marks row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The auto-responsive form layout publishes a private inherited --_form-layout-labels-aside property for its grid items (direct children and form row children). Fields switch their own grid to a fixed-width label column + input column via a container style query, so no subgrid and no JS are needed. Checkboxes, radio buttons and switches keep their label next to the control and are indented into the input column. Form items derive their label position from the same property, replacing the --_form-item-labels-above/aside pair previously published by the layout and the ::slotted inherit pass-through rules. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The form layout now applies a "label-aside" theme variant to its direct children instead of publishing an inherited custom property, and sets the labels-aside-active state attribute on the host. Add Lumo styles for the variant, stop forwarding it from date-time-picker to its inner pickers, and align slider, custom-field and date-time-picker with other fields on the same row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Apply the label-aside token only to children with a theme property. Every slotted child gets margin-inline-start of label width plus spacing through --_label-aside-indent; fields with the variant and form items set it to 0 since they render the label column themselves. Replaces the checkable indent rule. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Form row is display: contents with its own slot, so the layout's ::slotted rule never reaches the fields inside a row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Checkboxes, radio buttons and switches add a start margin of the form layout label width plus spacing when they inherit the labels-aside toggle, and default the toggle to false so nothing changes outside an auto-responsive layout. The layout now resets only block margins on its children so that margin can apply, and no longer indents anything itself. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Matches #12611, which removes the reset on main. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Keep the margin reset on auto-responsive children: Lumo buttons rely on it. Form layout and form row now indent vaadin-checkbox, vaadin-radio-button and vaadin-switch explicitly while labels are aside, and the checkable styles no longer know about the layout. The side label width and gap are passed to fields in every mode. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The layout no longer edits the theme attribute of its children. Fields match [data-form-layout-labels-aside] beside theme~=label-aside, and checkables indent themselves with padding because the layout margin reset cancels a host margin. Drops the branch's unit tests; visual tests will cover this. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Class selectors are cheaper to toggle/match than attribute selectors across the shared field-base and slider styles.
The layout marks every visible child with data-form-layout-item and adds the label-aside theme variant while labels fit aside. Field styles match the theme alone; the attribute scopes form-layout-only rules such as the checkable indent and the reserved label column for fields without a label. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…bute Replaces the `[theme~='label-aside']` + `data-form-layout-item` combo with a single `data-form-layout-labels-aside` attribute set by the layout, simplifying the CSS selectors and removing the theme-attribute juggling in `auto-responsive-layout.js`.
vursen
force-pushed
the
feat/form-layout-label-aside-fields
branch
from
September 7, 2026 08:15
ebc6f66 to
3dd8209
Compare
|
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.



Description
Depends on #12590
labelsAsidesets thedata-form-layout-labels-asideattribute on each child while labels fit beside the fields, and removes it when they fall back abovethemeattributelabel-asidetheme variant (text fields, pickers, select, combo boxes, custom field, checkbox and radio groups, sliders) also switch to the label-aside layout when the attribute is setvaadin-checkbox,vaadin-radio-buttonandvaadin-switchindent themselves by the label width plus spacing when the attribute is set, so their controls line up with the inputspadding-inline-start, since the layout resets child margins in auto-responsive modelabels-aside-activehost attribute, set while labels are displayed aside, and documented it and the child attribute in the JSDoc. It replaces the internalfits-labels-asideattribute on#layout--vaadin-field-side-label-widthand--vaadin-field-side-label-gap, so every field shares the same label column, also fields without a labelvaadin-form-itemwrappers in the labels-aside examples ofdev/form-layout-auto-responsive.htmlwith fields as direct childrenType of change
How to test
dev/form-layout-auto-responsive.html<vaadin-checkbox label="Newsletter">to one of those layouts: its box lines up with the inputsNote
Base theme only. The Lumo styles for the variant live on
feat/label-aside-lumo-stylesand still need thedata-form-layout-labels-asideselectors. Visual tests for this behavior are to be added separately. The slider label sits at the top of its row instead of on the input text line; that comes from the base variant in #12590, where#controlsis not baseline-aligned.🤖 Generated with Claude Code