form-layoutpackage.theme.lumo.vaadin-form-item-styles.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vaadin-webcomponents Show documentation
Show all versions of vaadin-webcomponents Show documentation
Mvnpm composite: Vaadin webcomponents
The newest version!
import '@vaadin/vaadin-lumo-styles/color.js';
import '@vaadin/vaadin-lumo-styles/spacing.js';
import '@vaadin/vaadin-lumo-styles/style.js';
import '@vaadin/vaadin-lumo-styles/typography.js';
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
registerStyles(
'vaadin-form-item',
css`
:host {
--vaadin-form-item-row-spacing: 0;
}
/* font-weight, margin-bottom, transition and line-height same as for part label in text-field */
[part='label'] {
color: var(--lumo-secondary-text-color);
font-family: var(--lumo-font-family);
font-size: var(--lumo-font-size-s);
font-weight: 500;
margin-top: var(--lumo-space-m);
margin-left: calc(var(--lumo-border-radius-m) / 4);
margin-bottom: var(--lumo-space-xs);
transition: color 0.4s;
line-height: 1.333;
}
[part='required-indicator']::after {
content: var(--lumo-required-field-indicator, '\\2022');
transition: opacity 0.2s;
opacity: 0;
color: var(--lumo-required-field-indicator-color, var(--lumo-primary-text-color));
position: relative;
width: 1em;
text-align: center;
}
:host([required]) [part='required-indicator']::after {
opacity: 1;
}
:host([invalid]) [part='required-indicator']::after {
color: var(--lumo-required-field-indicator-color, var(--lumo-error-text-color));
}
`,
{ moduleId: 'lumo-form-item' },
);