chromium/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.css

/* Copyright 2024 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

/* #css_wrapper_metadata_start
 * #type=style-lit
 * #scheme=relative
 * #css_wrapper_metadata_end */

:host {
  --cr-hairline: 1px solid var(--color-menu-separator,
      var(--cr-fallback-color-divider));
  --cr-action-menu-disabled-item-color:
      var(--color-menu-item-foreground-disabled,
          var(--cr-fallback-color-disabled-foreground));
  --cr-action-menu-disabled-item-opacity: 1;
  --cr-menu-background-color: var(--color-menu-background,
      var(--cr-fallback-color-surface));
  --cr-menu-background-focus-color: var(--cr-hover-background-color);
  --cr-menu-shadow: var(--cr-elevation-2);
  --cr-primary-text-color: var(--color-menu-item-foreground,
      var(--cr-fallback-color-on-surface));
}

:host dialog {
  background-color: var(--cr-menu-background-color);
  border: none;
  border-radius: var(--cr-menu-border-radius, 4px);
  box-shadow: var(--cr-menu-shadow);
  margin: 0;
  min-width: 128px;
  outline: none;
  padding: 0;
  position: absolute;
}

@media (forced-colors: active) {
  :host dialog {
    /* Use border instead of box-shadow (which does not work) in Windows
       HCM. */
    border: var(--cr-border-hcm);
  }
}

:host dialog::backdrop {
  background-color: transparent;
}

:host ::slotted(.dropdown-item) {
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
  color: var(--cr-primary-text-color);
  font: inherit;
  min-height: 32px;
  padding: 8px 24px;
  text-align: start;
  user-select: none;
  width: 100%;
}

:host ::slotted(.dropdown-item:not([hidden])) {
  align-items: center;
  display: flex;
}

:host ::slotted(.dropdown-item[disabled]) {
  color: var(--cr-action-menu-disabled-item-color,
      var(--cr-primary-text-color));
  opacity: var(--cr-action-menu-disabled-item-opacity, 0.65);
}

:host ::slotted(.dropdown-item:not([disabled])) {
  cursor: pointer;
}

:host ::slotted(.dropdown-item:focus) {
  background-color: var(--cr-menu-background-focus-color);
  outline: none;
}

@media (forced-colors: active) {
  :host ::slotted(.dropdown-item:focus) {
    /* Use outline instead of background-color (which does not work) in
       Windows HCM. */
    outline: var(--cr-focus-outline-hcm);
  }
}

.item-wrapper {
  outline: none;
  padding: var(--cr-action-menu-padding, 8px 0);
}