@coderundebug/ui-web
Version:
A collection of UI web components that can be used in any web project.
2 lines • 1.2 kB
JavaScript
/* By Stephen Paul Hassall (web: https://coderundebug.com) */
import{UiTools as o}from"./ui-tools.js";export class UiPopupMenu extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=UiPopupMenu.uiHtml,this.shadowRoot.adoptedStyleSheets=[UiPopupMenu.uiCssStyleSheet]}}UiPopupMenu.uiCss=" :host{display:flex;flex-direction:column;justify-content:center;flex-shrink:0;border-radius:var(--ui-border-radius-large, 6px);box-shadow:0 1px 4px 0 rgb(from var(--ui-module-foreground, hsl(0 0% 18% / 1)) r g b / 50%);background-color:var(--ui-menu-popup-background, var(--ui-module-background, hsl(0 0% 97% / 1)));color:var(--ui-menu-popup-foreground, var(--ui-module-foreground, hsl(0 0% 18% / 1)));position:relative;padding-top:var(--ui-border-radius-large, 6px);padding-bottom:var(--ui-border-radius-large, 6px);}::slotted(*:not(:defined)){display:none;}@media (forced-colors:active) or (prefers-contrast:more){:host{border-style:var(--ui-border-style, solid);border-color:var(--ui-foreground, black);border-width:var(--ui-border-width, 1px);padding:0;box-shadow:none;}} ",UiPopupMenu.uiHtml="<slot></slot>",o.createUi(UiPopupMenu,"ui-popup-menu",import.meta.url);