Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/form-layout/src/layouts/auto-responsive-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@

/** @private */
get __minWidthLabelsAside() {
const { backgroundPositionY } = getComputedStyle(this.host.$.layout, '::before');
return parseFloat(backgroundPositionY);
return parseFloat(getComputedStyle(this.host).getPropertyValue('--_min-width-labels-aside'));

Check warning on line 175 in packages/form-layout/src/layouts/auto-responsive-layout.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `Number.parseFloat` over `parseFloat`.

See more on https://sonarcloud.io/project/issues?id=vaadin_web-components&issues=AZql2zqO0aapVAoIfPl7&open=AZql2zqO0aapVAoIfPl7&pullRequest=10531
}

/** @private */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import '@vaadin/component-base/src/styles/style-props.js';
import { css } from 'lit';
import { addGlobalThemeStyles } from '@vaadin/vaadin-themable-mixin/register-styles.js';

CSS.registerProperty({
name: '--_min-width-labels-aside',
syntax: '<length>',
inherits: false,
initialValue: '0px',
});

addGlobalThemeStyles(
'vaadin-form-layout-base',
css`
Expand Down Expand Up @@ -132,10 +139,6 @@ export const formLayoutStyles = css`
width: var(--_max-width);
}

:host([auto-responsive]) #layout::before {
background-position-y: var(--_min-width-labels-aside);
}

:host([auto-responsive]) #layout ::slotted(*) {
/* Make form items inherit label position from the layout */
--_form-item-labels-above: inherit;
Expand Down