number-fieldpackage.theme.lumo.vaadin-number-field-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!
/**
* @license
* Copyright (c) 2021 - 2024 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';
import '@vaadin/vaadin-lumo-styles/sizing.js';
import { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
const numberField = css`
:host([step-buttons-visible]:not([theme~='align-right'])) ::slotted(input) {
text-align: center;
}
:host(:not([disabled])) [part$='button'][disabled] {
opacity: 0.2;
}
:host([step-buttons-visible]) [part='input-field'] {
padding: 0;
}
[part$='button'] {
cursor: pointer;
font-size: var(--lumo-icon-size-s);
width: 1.6em;
height: 1.6em;
}
[part$='button']::before {
margin-top: 0.3em;
}
[part='decrease-button']::before {
content: var(--lumo-icons-minus);
}
[part='increase-button']::before {
content: var(--lumo-icons-plus);
}
/* RTL specific styles */
:host([dir='rtl']:not([theme~='align-right'])) ::slotted(input) {
--_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
}
`;
registerStyles('vaadin-number-field', [inputFieldShared, numberField], {
moduleId: 'lumo-number-field',
});