chromium/ui/file_manager/file_manager/foreground/css/menu.css

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

cr-menu {
  position: fixed;
  white-space: nowrap;
  z-index: 3;
}

cr-menu:not(.decorated) {
  display: none;
}

cr-menu > * {
  box-sizing: border-box;
  display: block;
  text-align: start;
  width: 100%;
}

cr-menu > hr {
  border: 0;
  height: 1px;
}

cr-menu > [hidden] {
  display: none;
}

cr-menu > [shortcutText]::after {
  color: var(--cros-sys-secondary);
  content: attr(shortcutText);
  float: right;
  padding-inline-start: 30px;
}

cr-menu > [shortcutText][disabled]::after {
  color: var(--cros-sys-disabled);
}

html[dir='rtl'] cr-menu > [shortcutText]::after {
  float: left;
}

cr-menu > [sub-menu]::after {
  -webkit-mask-image: url(../images/files/ui/arrow_right.svg);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  background-color: currentColor;
  content: '';
  float: right;
  height: 20px;
  /* Trailing icon has a different padding than its container padding (16px). */
  margin-inline-end: calc(12px - 16px);
  width: 20px;
}

html[dir='rtl'] cr-menu > [sub-menu]::after {
  float: left;
  transform: scaleX(-1);
}

cr-menu > [sub-menu][disabled]::after {
  background-color: var(--cros-sys-disabled);
}

/* Keeps menu visible while animating. Fade out animation is performed by
   Javascript. */
cr-menu[hidden].files-menu.animating {
  opacity: 1;
  visibility: visible;
}

cr-menu.files-menu > cr-menu-item {
  align-items: center;
  display: flex;
  flex-direction: row;
  position: relative;
}

/* Icon on the left of the item label for cr.ui.FilesMenuItem.
   TODO(mtomasz): Upstream to cr.ui.MenuItem. */
cr-menu.files-menu cr-menu-item .icon {
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 20px 20px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  height: 36px;
  width: 20px;
}

cr-menu.files-menu cr-menu-item .icon.start {
  align-self: flex-start;
  margin-inline-end: 16px;
}

cr-menu.files-menu:not(.has-icon-start) cr-menu-item .icon.start {
  display: none;
}

cr-menu.files-menu cr-menu-item .icon.managed {
  background-image: url(chrome://resources/images/business.svg);
  margin-inline-start: 16px;
}

cr-menu.files-menu cr-menu-item .icon.end {
  align-self: flex-end;
  /* Trailing icon has a different padding than its container padding (16px). */
  margin-inline-end: calc(12px - 16px);
  margin-inline-start: 16px;
}

cr-menu.files-menu > cr-menu-item > .icon {
  z-index: 1;
}

cr-menu.files-menu > cr-menu-item > span,
cr-menu.files-menu > cr-menu-item > div:not(.icon) {
  flex-grow: 1;
  z-index: 1;
}

cr-menu.files-menu > cr-menu-item > paper-ripple {
  z-index: 0;
}

cr-menu.files-menu > cr-menu-item {
  padding: 0 16px;
}

html.pointer-active cr-menu-item > paper-ripple {
  --paper-ripple-opacity: 100%;
  color: var(--cros-sys-ripple_neutral_on_subtle);
}

cr-menu.files-menu > cr-menu-item:not([disabled])[selected],
cr-menu.files-menu > cr-menu-item:not([disabled]):active {
  background-color: var(--cros-sys-hover_on_subtle);
}

html:not(.pointer-active)
    cr-menu.files-menu > cr-menu-item:not([disabled]):active[selected] {
  background-color: var(--cros-sys-hover_on_subtle);
}

html.focus-outline-visible
    cr-menu.files-menu > cr-menu-item:not([disabled])[selected] {
  background-color: unset;
}

html.focus-outline-visible
    cr-menu.files-menu > cr-menu-item:not([disabled])[selected]::before {
  border: 2px solid var(--cros-sys-focus_ring);
  border-radius: 8px;
  content: '';
  height: 100%;
  left: 0;
  position: absolute;
  top: -2px; /* border-width offset */
  width: calc(100% - 4px); /* 2 x border width */
}