kopia lustrzana https://github.com/shoelace-style/shoelace
85 wiersze
1.9 KiB
TypeScript
85 wiersze
1.9 KiB
TypeScript
import { css } from 'lit';
|
|
import { focusVisibleSelector } from '~/internal/focus-visible';
|
|
import componentStyles from '~/styles/component.styles';
|
|
|
|
export default css`
|
|
${componentStyles}
|
|
|
|
:host {
|
|
display: block;
|
|
}
|
|
|
|
.menu-item {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: stretch;
|
|
font-family: var(--sl-font-sans);
|
|
font-size: var(--sl-font-size-medium);
|
|
font-weight: var(--sl-font-weight-normal);
|
|
line-height: var(--sl-line-height-normal);
|
|
letter-spacing: var(--sl-letter-spacing-normal);
|
|
text-align: left;
|
|
color: var(--sl-color-neutral-700);
|
|
padding: var(--sl-spacing-2x-small) var(--sl-spacing-2x-small);
|
|
transition: var(--sl-transition-fast) fill;
|
|
user-select: none;
|
|
white-space: nowrap;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.menu-item.menu-item--disabled {
|
|
outline: none;
|
|
color: var(--sl-color-neutral-400);
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.menu-item .menu-item__label {
|
|
flex: 1 1 auto;
|
|
}
|
|
|
|
.menu-item .menu-item__prefix {
|
|
flex: 0 0 auto;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.menu-item .menu-item__prefix ::slotted(*) {
|
|
margin-right: var(--sl-spacing-x-small);
|
|
}
|
|
|
|
.menu-item .menu-item__suffix {
|
|
flex: 0 0 auto;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.menu-item .menu-item__suffix ::slotted(*) {
|
|
margin-left: var(--sl-spacing-x-small);
|
|
}
|
|
|
|
:host(:focus) {
|
|
outline: none;
|
|
}
|
|
|
|
:host(:hover:not([aria-disabled='true'])) .menu-item,
|
|
:host(${focusVisibleSelector}:not(.sl-focus-invisible):not([aria-disabled='true'])) .menu-item {
|
|
outline: none;
|
|
background-color: var(--sl-color-primary-600);
|
|
color: var(--sl-color-neutral-0);
|
|
}
|
|
|
|
.menu-item .menu-item__check,
|
|
.menu-item .menu-item__chevron {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 1.5em;
|
|
visibility: hidden;
|
|
}
|
|
|
|
.menu-item--checked .menu-item__check,
|
|
.menu-item--has-submenu .menu-item__chevron {
|
|
visibility: visible;
|
|
}
|
|
`;
|