y玻璃样式

* {
  outline: none;
  box-sizing: border-box;
}

:root {
  /* 主题背景颜色 */
  --theme-bg-color: rgba(16 18 27 / 40%);
  /* 边框颜色 */
  --border-color: rgba(113 119 144 / 25%);
  /* 主题色 */
  --theme-color: #f9fafb;
  /* 无行动的;不活动的;不活跃的;未使用的颜色 */
  --inactive-color: rgb(113 119 144 / 78%);
  --body-font: "Poppins", sans-serif;
  /* 菜单选中背景颜色 */
  --hover-menu-bg: rgba(12 15 25 / 30%);
  /* 内容标题颜色 */
  --content-title-color: #999ba5;
  /* 内容背景色 */
  --content-bg: rgb(146 151 179 / 13%);

  --button-inactive: rgb(249 250 251 / 55%);
  /* 下拉菜单背景颜色 */
  --dropdown-bg: #21242d;
  --dropdown-hover: rgb(42 46 60);
  /* 弹出框 */
  --popup-bg: rgb(22 25 37);
  --search-bg: #14162b;
  /* 遮罩层 */
  --overlay-bg: rgba(36, 39, 59, 0.3);
  --scrollbar-bg: rgb(1 2 3 / 40%);
}

.light-mode {
  --theme-bg-color: rgb(255 255 255 / 31%);
  --theme-color: #3c3a3a;
  --inactive-color: #333333;
  --button-inactive: #3c3a3a;
  --search-bg: rgb(255 255 255 / 31%);
  --dropdown-bg: #f7f7f7;
  --overlay-bg: rgb(255 255 255 / 30%);
  --dropdown-hover: rgb(236 236 236);
  --border-color: rgb(255 255 255 / 35%);
  --popup-bg: rgb(255 255 255);
  --hover-menu-bg: rgba(255 255 255 / 35%);
  --scrollbar-bg: rgb(255 253 253 / 57%);
  --content-title-color: --theme-color;
}

html {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--body-font);
  background-image: url(https://wallpapershome.com/images/wallpapers/macos-big-sur-1280x720-dark-wwdc-2020-22655.jpg);
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 2em;
  width: 100%;
  height: 100vh;
}
@media screen and (max-width: 480px) {
  body {
    padding: 0.8em;
  }
}

body.light-mode:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.45) 100%);
  backdrop-filter: saturate(3);
}


::-webkit-scrollbar {
 width: 6px;
 border-radius: 10px;
}

::-webkit-scrollbar-thumb {
 background: var(--scrollbar-bg);
 border-radius: 10px;
}

posted @ 2022-09-05 22:47  一星一辰  阅读(30)  评论(0编辑  收藏  举报