element-plus.scss 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. .el-form-item__label {
  2. font-weight: 700;
  3. }
  4. .el-breadcrumb__inner,
  5. .el-breadcrumb__inner a {
  6. font-weight: 400 !important;
  7. }
  8. .el-dropdown-menu {
  9. padding: 0 !important;
  10. }
  11. .is-dark {
  12. z-index: 9999 !important;
  13. }
  14. /* 重置 el-button 中 icon 的 margin */
  15. .reset-margin [class*="el-icon"] + span {
  16. margin-left: 2px !important;
  17. }
  18. /* 自定义 popover 的类名 */
  19. .pure-popper {
  20. padding: 0 !important;
  21. }
  22. /* nprogress 适配 element-plus 的主题色 */
  23. #nprogress {
  24. & .bar {
  25. background-color: var(--el-color-primary) !important;
  26. }
  27. & .peg {
  28. box-shadow:
  29. 0 0 10px var(--el-color-primary),
  30. 0 0 5px var(--el-color-primary) !important;
  31. }
  32. & .spinner-icon {
  33. border-top-color: var(--el-color-primary);
  34. border-left-color: var(--el-color-primary);
  35. }
  36. }
  37. .pure-dialog {
  38. .el-dialog__header.show-close {
  39. padding-right: 16px;
  40. }
  41. .el-dialog__headerbtn {
  42. top: 16px;
  43. right: 12px;
  44. width: 24px;
  45. height: 24px;
  46. }
  47. .pure-dialog-svg {
  48. color: var(--el-color-info);
  49. }
  50. .el-dialog__footer {
  51. padding-top: 0;
  52. }
  53. }
  54. /* 全局覆盖element-plus的el-tour、el-dialog、el-drawer、el-message-box、el-notification组件右上角关闭图标和el-upload上传文件列表右侧关闭图标的样式,表现更鲜明 */
  55. .el-dialog__headerbtn,
  56. .el-message-box__headerbtn {
  57. &:hover {
  58. .el-dialog__close {
  59. color: var(--el-color-info) !important;
  60. }
  61. }
  62. }
  63. .el-icon {
  64. &.el-tour__close,
  65. &.el-dialog__close,
  66. &.el-drawer__close,
  67. &.el-message-box__close,
  68. &.el-notification__closeBtn,
  69. .el-upload-list__item.is-ready &.el-icon--close {
  70. width: 24px;
  71. height: 24px;
  72. outline: none;
  73. border-radius: 4px;
  74. transition:
  75. background-color 0.2s,
  76. color 0.2s;
  77. &:hover {
  78. color: rgb(0 0 0 / 88%) !important;
  79. text-decoration: none;
  80. background-color: rgb(0 0 0 / 6%);
  81. .pure-dialog-svg {
  82. color: rgb(0 0 0 / 88%) !important;
  83. }
  84. }
  85. }
  86. }
  87. /* 克隆并自定义 ElMessage 样式,不会影响 ElMessage 原本样式,在 src/utils/message.ts 中调用自定义样式 ElMessage 方法即可,整体暗色风格在 src/style/dark.scss 文件进行了适配 */
  88. .pure-message {
  89. background: #fff !important;
  90. border-width: 0 !important;
  91. box-shadow:
  92. 0 3px 6px -4px #0000001f,
  93. 0 6px 16px #00000014,
  94. 0 9px 28px 8px #0000000d !important;
  95. & .el-message__content {
  96. color: #000000d9 !important;
  97. pointer-events: all !important;
  98. background-image: initial !important;
  99. }
  100. & .el-message__closeBtn {
  101. outline: none;
  102. border-radius: 4px;
  103. transition:
  104. background-color 0.2s,
  105. color 0.2s;
  106. &:hover {
  107. background-color: rgb(0 0 0 / 6%);
  108. }
  109. }
  110. }
  111. /* 自定义菜单搜索样式 */
  112. .pure-search-dialog {
  113. @media screen and (width > 760px) and (width <= 940px) {
  114. .el-input__inner {
  115. font-size: 12px;
  116. }
  117. }
  118. @media screen and (width <= 470px) {
  119. .el-input__inner {
  120. font-size: 12px;
  121. }
  122. }
  123. .el-dialog__header {
  124. display: none;
  125. }
  126. .el-input__inner {
  127. font-size: 1.2em;
  128. }
  129. .el-dialog__footer {
  130. width: calc(100% + 32px);
  131. padding: 10px 20px;
  132. margin: auto -16px -16px;
  133. box-shadow:
  134. 0 -1px 0 0 #e0e3e8,
  135. 0 -3px 6px 0 rgb(69 98 155 / 12%);
  136. }
  137. }
  138. /* 仿 el-scrollbar 滚动条样式,支持大多数浏览器,如Chrome、Edge、Firefox、Safari等。整体暗色风格在 src/style/dark.scss 文件进行了适配 */
  139. .pure-scrollbar {
  140. scrollbar-color: rgb(221 222 224) transparent; /* 滑块颜色、轨道颜色 */
  141. /* Firefox */
  142. scrollbar-width: thin; /* 可选值为 'auto', 'thin', 'none' */
  143. ::-webkit-scrollbar {
  144. width: 6px; /* 滚动条宽度 */
  145. }
  146. /* 滚动条轨道 */
  147. ::-webkit-scrollbar-track {
  148. background: transparent; /* 轨道颜色 */
  149. }
  150. /* 滚动条滑块 */
  151. ::-webkit-scrollbar-thumb {
  152. background-color: rgb(221 222 224);
  153. border-radius: 4px;
  154. }
  155. /* 滚动条滑块:hover状态 */
  156. ::-webkit-scrollbar-thumb:hover {
  157. background: rgb(199 201 203); /* 滑块hover颜色 */
  158. }
  159. }