Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: use CSS gap for row and column spacing #8638

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

vursen
Copy link
Contributor

@vursen vursen commented Feb 5, 2025

Description

Refactors the FormLayout component to use CSS gap for defining spacing between rows and columns. The row gap is controlled by --vaadin-form-layout-row-spacing, which defaults to 0. The deprecated --vaadin-form-item-row-spacing still applies as long as --vaadin-form-layout-row-spacing remains at 0, ensuring backwards compatibility until Vaadin 25 where it will be dropped.

Warning

The change is still considered breaking because it can increase the default intrinsic width of dialogs with form layouts. See vaadin/flow-components#2201, #949, and CRUD screenshots in this PR for more insights.

Part of #8583

Type of change

  • Refactor

@vursen vursen changed the title refactor!: update form-layout to use CSS gap for row and column spacing refactor!: use CSS gap instead of margin for row and column spacing Feb 5, 2025
@vursen vursen force-pushed the refactor-form-layout-to-use-CSS-gaps branch 2 times, most recently from fec1f8a to fd597be Compare February 5, 2025 07:54
@vursen vursen force-pushed the refactor-form-layout-to-use-CSS-gaps branch from fd597be to 2c660a6 Compare February 5, 2025 10:48
@vursen vursen changed the title refactor!: use CSS gap instead of margin for row and column spacing refactor!: use CSS gap for row and column spacing Feb 5, 2025
@vursen vursen force-pushed the refactor-form-layout-to-use-CSS-gaps branch from efe89ef to 062adbe Compare February 5, 2025 14:26
@@ -6,7 +6,7 @@ registerStyles(
css`
:host {
--vaadin-form-layout-column-spacing: var(--lumo-space-l);
--vaadin-form-layout-row-spacing: 0;
--vaadin-form-item-row-spacing: 0;
Copy link
Contributor Author

@vursen vursen Feb 5, 2025

Choose a reason for hiding this comment

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

This is needed to override the default 1em value because it's now a part of the var expression: https://github.com/vaadin/web-components/pull/8638/files#diff-6ad2d1beab300f671707a82e473d6377e11eb67525696d17cc7ceb3097b6bd3fR54

@vursen vursen requested a review from DiegoCardoso February 5, 2025 14:41
@vursen vursen added the needs discussion No decision yet, discussion needed label Feb 6, 2025
Copy link

sonarqubecloud bot commented Feb 8, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion No decision yet, discussion needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant