vaadin-lumo-stylespackage.mixins.helper.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
/**
* @license
* Copyright (c) 2017 - 2024 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import '../color.js';
import '../sizing.js';
import '../style.js';
import '../typography.js';
import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
export const helper = css`
:host {
--_helper-spacing: var(--vaadin-input-field-helper-spacing, 0.4em);
}
:host([has-helper]) [part='helper-text']::before {
content: '';
display: block;
height: var(--_helper-spacing);
}
[part='helper-text'] {
display: block;
color: var(--vaadin-input-field-helper-color, var(--lumo-secondary-text-color));
font-size: var(--vaadin-input-field-helper-font-size, var(--lumo-font-size-xs));
line-height: var(--lumo-line-height-xs);
font-weight: var(--vaadin-input-field-helper-font-weight, 400);
margin-left: calc(var(--lumo-border-radius-m) / 4);
transition: color 0.2s;
}
:host(:hover:not([readonly])) [part='helper-text'] {
color: var(--lumo-body-text-color);
}
:host([disabled]) [part='helper-text'] {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
}
:host([has-helper][theme~='helper-above-field']) [part='helper-text']::before {
display: none;
}
:host([has-helper][theme~='helper-above-field']) [part='helper-text']::after {
content: '';
display: block;
height: var(--_helper-spacing);
}
:host([has-helper][theme~='helper-above-field']) [part='label'] {
order: 0;
padding-bottom: var(--_helper-spacing);
}
:host([has-helper][theme~='helper-above-field']) [part='helper-text'] {
order: 1;
}
:host([has-helper][theme~='helper-above-field']) [part='label'] + * {
order: 2;
}
:host([has-helper][theme~='helper-above-field']) [part='error-message'] {
order: 3;
}
`;