<commit_before>//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

@import "@material/animation/variables";
@import "@material/elevation/mixins";
@import "@material/theme/mixins";
@import "@material/theme/variables";
@import "@material/typography/mixins";

$mdc-menu-fade-in-duration: .03s;
$mdc-menu-fade-out-duration: .075s;
$mdc-menu-scale-duration: .12s;

// postcss-bem-linter: define menu
.mdc-menu {
  @include mdc-elevation(2);

  display: none;
  position: absolute;
  box-sizing: border-box;
  min-width: 170px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  margin: 0;
  padding: 0;
  transform: scale(1);
  transform-origin: top left;
  border-radius: 2px;
  background-color: $mdc-theme-background;
  opacity: 0;
  white-space: nowrap;
  overflow-x: hidden;
  overflow-y: auto;
  will-change: transform, opacity;
  z-index: 4;

  &:focus {
    outline: none;
  }

  &--animating-open {
    display: inline-block;
    transform: scale(.8);
    transition:
      opacity $mdc-menu-fade-in-duration linear,
      transform $mdc-menu-scale-duration $mdc-animation-deceleration-curve-timing-function;
    opacity: 0;
    overflow-y: hidden;
  }

  &--open {
    display: inline-block;
    transform: scale(1);
    opacity: 1;
  }

  &--animating-closed {
    display: inline-block;
    transition: opacity $mdc-menu-fade-out-duration linear;
    opacity: 0;
    overflow-y: hidden;
  }

  &__items {
    box-sizing: border-box;
    transform: scale(1);
    overflow-x: hidden;
    overflow-y: auto;
    will-change: transform;

    // stylelint-disable plugin/selector-bem-pattern
    > .mdc-list-item {
      cursor: pointer;
    }
    // stylelint-enable plugin/selector-bem-pattern

    .mdc-menu--animating & {
      overflow-y: hidden;
    }
  }

  &--animating-open > .mdc-menu__items {
    transform: scale(1.25);
  }

  &--open > .mdc-menu__items {
    transform: scale(1);
  }

  // stylelint-disable plugin/selector-bem-pattern
  [dir="rtl"] & {
    transform-origin: top right;
  }

  .mdc-list-group,
  .mdc-list {
    padding: 8px 0;
  }

  .mdc-list-item {
    @include mdc-typography(subheading2);

    position: relative;
    outline: none;
    color: inherit;
    text-decoration: none;
    user-select: none;
  }

  .mdc-list-item__graphic {
    @include mdc-theme-prop(color, text-secondary-on-background);
  }

  .mdc-list-item[aria-disabled="true"] {
    @include mdc-theme-prop(color, text-disabled-on-background);

    cursor: default;
    pointer-events: none;

    // TODO(#1495): Disabled menu items shouldn't be focusable, so this style shouldn't be necessary.
    &:focus::before {
      opacity: 0;
    }
  }
  // stylelint-enable plugin/selector-bem-pattern
}

// stylelint-disable plugin/selector-bem-pattern
.mdc-menu-anchor {
  position: relative;
  overflow: visible;
}
// stylelint-enable plugin/selector-bem-pattern

// postcss-bem-linter: end
<commit_msg>fix(menu): Use mdc-theme-prop to support css variables on background (#2253)<commit_after>//
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

@import "@material/animation/variables";
@import "@material/elevation/mixins";
@import "@material/theme/mixins";
@import "@material/theme/variables";
@import "@material/typography/mixins";

$mdc-menu-fade-in-duration: .03s;
$mdc-menu-fade-out-duration: .075s;
$mdc-menu-scale-duration: .12s;

// postcss-bem-linter: define menu
.mdc-menu {
  @include mdc-elevation(2);
  @include mdc-theme-prop(background-color, background);

  display: none;
  position: absolute;
  box-sizing: border-box;
  min-width: 170px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  margin: 0;
  padding: 0;
  transform: scale(1);
  transform-origin: top left;
  border-radius: 2px;
  opacity: 0;
  white-space: nowrap;
  overflow-x: hidden;
  overflow-y: auto;
  will-change: transform, opacity;
  z-index: 4;

  &:focus {
    outline: none;
  }

  &--animating-open {
    display: inline-block;
    transform: scale(.8);
    transition:
      opacity $mdc-menu-fade-in-duration linear,
      transform $mdc-menu-scale-duration $mdc-animation-deceleration-curve-timing-function;
    opacity: 0;
    overflow-y: hidden;
  }

  &--open {
    display: inline-block;
    transform: scale(1);
    opacity: 1;
  }

  &--animating-closed {
    display: inline-block;
    transition: opacity $mdc-menu-fade-out-duration linear;
    opacity: 0;
    overflow-y: hidden;
  }

  &__items {
    box-sizing: border-box;
    transform: scale(1);
    overflow-x: hidden;
    overflow-y: auto;
    will-change: transform;

    // stylelint-disable plugin/selector-bem-pattern
    > .mdc-list-item {
      cursor: pointer;
    }
    // stylelint-enable plugin/selector-bem-pattern

    .mdc-menu--animating & {
      overflow-y: hidden;
    }
  }

  &--animating-open > .mdc-menu__items {
    transform: scale(1.25);
  }

  &--open > .mdc-menu__items {
    transform: scale(1);
  }

  // stylelint-disable plugin/selector-bem-pattern
  [dir="rtl"] & {
    transform-origin: top right;
  }

  .mdc-list-group,
  .mdc-list {
    padding: 8px 0;
  }

  .mdc-list-item {
    @include mdc-typography(subheading2);

    position: relative;
    outline: none;
    color: inherit;
    text-decoration: none;
    user-select: none;
  }

  .mdc-list-item__graphic {
    @include mdc-theme-prop(color, text-secondary-on-background);
  }

  .mdc-list-item[aria-disabled="true"] {
    @include mdc-theme-prop(color, text-disabled-on-background);

    cursor: default;
    pointer-events: none;

    // TODO(#1495): Disabled menu items shouldn't be focusable, so this style shouldn't be necessary.
    &:focus::before {
      opacity: 0;
    }
  }
  // stylelint-enable plugin/selector-bem-pattern
}

// stylelint-disable plugin/selector-bem-pattern
.mdc-menu-anchor {
  position: relative;
  overflow: visible;
}
// stylelint-enable plugin/selector-bem-pattern

// postcss-bem-linter: end

{'fraction_non_alphanumeric': 0.13927102538647002, 'fraction_numerical': 0.015600624024960999, 'mean_word_length': 2.968486212718064, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3690108', 'n_tokens_mistral': 2495, 'n_tokens_neox': 2360, 'n_words': 568}