UNPKG

@synergy-design-system/components

Version:

This package provides the base of the Synergy Design System as native web components. It uses [lit](https://www.lit.dev) and parts of [shoelace](https://shoelace.style/). Synergy officially supports the latest two versions of all major browsers (as define

134 lines (113 loc) 3.42 kB
// src/components/menu-item/menu-item.custom.styles.ts import { css } from "lit"; var menu_item_custom_styles_default = css` :host { /* Custom override for hiding the checkmark in menus it is not needed */ --display-checkmark: flex; } .menu-item { color: var(--syn-typography-color-text); font-size: var(--syn-font-size-medium); padding: var(--syn-spacing-small) var(--syn-spacing-medium); } /** #429: Use token for opacity */ .menu-item.menu-item--disabled { opacity: var(--syn-opacity-50); } /** * Handling for slotted prefix and suffix */ .menu-item .menu-item__prefix::slotted(*) { margin-inline-end: var(--syn-spacing-small); } .menu-item .menu-item__suffix::slotted(*) { margin-inline-start: var(--syn-spacing-small); } /** * Set the default font size to make icons appear correct */ .menu-item .menu-item__prefix::slotted(syn-icon), .menu-item .menu-item__suffix::slotted(syn-icon) { color: var(--syn-color-neutral-800); font-size: var(--syn-font-size-x-large); } :host(:focus-visible) .menu-item .menu-item__prefix::slotted(syn-icon), :host(:focus-visible) .menu-item .menu-item__suffix::slotted(syn-icon) { color: var(--syn-color-neutral-0); } /** * Adjust the size of icons */ .menu-item .menu-item__chevron, .menu-item .menu-item__check { display: var(--display-checkmark); font-size: var(--syn-font-size-x-large); width: var(--syn-font-size-x-large); } /** * This makes sure the chevron does not take any space if we do not have children */ .menu-item .menu-item__chevron { display: none; margin-inline-start: var(--syn-spacing-small); } .menu-item .menu-item__check { color: var(--syn-color-primary-600); margin-inline-end: var(--syn-spacing-small); } /** * When in loading state, do not show the checkmark as it would bleed through */ .menu-item--loading .menu-item__check { visibility: hidden; } /** * Make sure the checkbox is also visible when the item is active */ :host(:focus-visible) .menu-item--checked .menu-item__check { color: var(--syn-color-neutral-0); } /** * Special handling for the submenu chevron: * We are using the "chevron-down" icon per default as * we do not want all chevrons to be part of the bundle * Therefore, we have to transform it into the right direction */ .menu-item .menu-item__chevron syn-icon { transform: rotate(-90deg); } .menu-item--rtl .menu-item__chevron syn-icon { transform: rotate(90deg); } .menu-item.menu-item--loading *:not(syn-spinner) { opacity: var(--syn-opacity-50); } /** * Make sure to show the chevron if there are children */ .menu-item--has-submenu .menu-item__chevron { display: flex; } /** * Adjustments for the spinner in loading state */ .menu-item--loading syn-spinner { --track-width: 2px; font-size: var(--syn-font-size-medium); left: var(--syn-spacing-medium); } /** * Highlight checked items */ .menu-item--checked .menu-item__label { font-weight: var(--syn-font-weight-semibold); } /* Needed if we do not show the checkmark */ :host(:not([type="checkmark"]):not([loading])) .menu-item__label { min-height: var(--syn-font-size-x-large); } `; export { menu_item_custom_styles_default }; //# sourceMappingURL=chunk.JQ5WZR46.js.map