scss CSS Only Dropdown

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss CSS Only Dropdown相关的知识,希望对你有一定的参考价值。

.dropdown
  button.dropdown_btn Item Label
  .dropdown_overlay
  .dropdown_body
    p body
.dropdown_btn {
  cursor: pointer;
  position: relative;
  z-index: 1001;
}

.dropdown_body {
  opacity: 0;
  visibility: hidden;
  position: fixed;
  top: 0;
  right: 0;
  background-color: #ffffff;
  transition: opacity .2s .2s ease-out, visibility .2s .2s ease;
  z-index: 1001;
  @include media() {
    .dropdown:hover & {
      opacity: 1;
      visibility: visible;
    }
  }
}

.dropdown_overlay {
  opacity: 0;
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,.5);
  z-index: 1000;
  transition: opacity .2s .2s ease-out, visibility .2s .2s ease;
  pointer-events: none;
  @include media() {
    .dropdown:hover & {
      opacity: 1;
      visibility: visible;
    }
  }
}

以上是关于scss CSS Only Dropdown的主要内容,如果未能解决你的问题,请参考以下文章

scss dropdown.scss

为啥 :read-only CSS 伪类应用于此复选框?

Bootstrap源码分析之dropdown

CSS组件

css make dropdown子菜单取其父级的宽度

CSS:-webkit-appearance:menulist Dropdown(选择标签),如何给箭头填充?