package.theme.lumo.vaadin-multi-select-combo-box-chip-styles.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multi-select-combo-box Show documentation
Show all versions of multi-select-combo-box Show documentation
vaadin-multi-select-combo-box
/**
* @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/vaadin-lumo-styles/color.js';
import '@vaadin/vaadin-lumo-styles/font-icons.js';
import '@vaadin/vaadin-lumo-styles/spacing.js';
import '@vaadin/vaadin-lumo-styles/style.js';
import '@vaadin/vaadin-lumo-styles/typography.js';
import { fieldButton } from '@vaadin/vaadin-lumo-styles/mixins/field-button.js';
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
const chip = css`
:host {
font-size: var(--lumo-font-size-xxs);
line-height: 1;
color: var(--lumo-body-text-color);
border-radius: var(--lumo-border-radius-s);
background-color: var(--lumo-contrast-20pct);
cursor: var(--lumo-clickable-cursor);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
:host([focused]) [part='remove-button'] {
color: inherit;
}
:host([slot='overflow']) {
position: relative;
min-width: var(--lumo-size-xxs);
margin-inline-start: var(--lumo-space-s);
}
:host([slot='overflow'])::before,
:host([slot='overflow'])::after {
position: absolute;
content: '';
width: 100%;
height: 100%;
border-left: calc(var(--lumo-space-s) / 4) solid;
border-radius: var(--lumo-border-radius-s);
border-color: var(--lumo-contrast-30pct);
}
:host([slot='overflow'])::before {
left: calc(-1 * var(--lumo-space-s) / 2);
}
:host([slot='overflow'])::after {
left: calc(-1 * var(--lumo-space-s));
}
:host([count='2']) {
margin-inline-start: calc(var(--lumo-space-s) / 2);
}
:host([count='2'])::after {
display: none;
}
:host([count='1']) {
margin-inline-start: 0;
}
:host([count='1'])::before,
:host([count='1'])::after {
display: none;
}
[part='label'] {
font-weight: 500;
line-height: 1.25;
}
[part='remove-button'] {
display: flex;
align-items: center;
justify-content: center;
margin-top: -0.3125em;
margin-bottom: -0.3125em;
margin-inline-start: auto;
width: 1.25em;
height: 1.25em;
font-size: 1.5em;
transition: none;
}
[part='remove-button']::before {
content: var(--lumo-icons-cross);
}
:host([disabled]) [part='label'] {
color: var(--lumo-disabled-text-color);
-webkit-text-fill-color: var(--lumo-disabled-text-color);
pointer-events: none;
}
`;
registerStyles('vaadin-multi-select-combo-box-chip', [fieldButton, chip], {
moduleId: 'lumo-multi-select-combo-box-chip',
});