_background.scss 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /* ==================
  2. 背景
  3. ==================== */
  4. /* -- 基础色 -- */
  5. @each $color, $value in map-merge($colors, $darks) {
  6. .bg-#{$color} {
  7. background-color: $value !important;
  8. @if $color == 'yellow' {
  9. color: #333333 !important;
  10. } @else {
  11. color: #ffffff !important;
  12. }
  13. }
  14. }
  15. /* -- 浅色 -- */
  16. @each $color, $value in $colors {
  17. .bg-#{$color}-light {
  18. background-image: linear-gradient(45deg, white, mix(white, $value, 85%)) !important;
  19. color: $value !important;
  20. }
  21. .bg-#{$color}-thin {
  22. background-color: rgba($value, var(--ui-BG-opacity)) !important;
  23. color: $value !important;
  24. }
  25. }
  26. /* -- 渐变色 -- */
  27. @each $color, $value in $colors {
  28. @each $colorsub, $valuesub in $colors {
  29. @if $color != $colorsub {
  30. .bg-#{$color}-#{$colorsub} {
  31. // background-color: $value !important;
  32. background-image: linear-gradient(130deg, $value, $valuesub) !important;
  33. color: #ffffff !important;
  34. }
  35. }
  36. }
  37. }
  38. .bg-yellow-gradient {
  39. background-image: linear-gradient(45deg, #f5fe00, #ff6600) !important;
  40. color: $dark-3 !important;
  41. }
  42. .bg-orange-gradient {
  43. background-image: linear-gradient(90deg, #ff6000, #fe832a) !important;
  44. color: $white !important;
  45. }
  46. .bg-red-gradient {
  47. background-image: linear-gradient(45deg, #f33a41, #ed0586) !important;
  48. color: $white !important;
  49. }
  50. .bg-pink-gradient {
  51. background-image: linear-gradient(45deg, #fea894, #ff1047) !important;
  52. color: $white !important;
  53. }
  54. .bg-mauve-gradient {
  55. background-image: linear-gradient(45deg, #c01f95, #7115cc) !important;
  56. color: $white !important;
  57. }
  58. .bg-purple-gradient {
  59. background-image: linear-gradient(45deg, #9829ea, #5908fb) !important;
  60. color: $white !important;
  61. }
  62. .bg-blue-gradient {
  63. background-image: linear-gradient(45deg, #00b8f9, #0166eb) !important;
  64. color: $white !important;
  65. }
  66. .bg-cyan-gradient {
  67. background-image: linear-gradient(45deg, #06edfe, #48b2fe) !important;
  68. color: $white !important;
  69. }
  70. .bg-green-gradient {
  71. background-image: linear-gradient(45deg, #3ab54a, #8cc63f) !important;
  72. color: $white !important;
  73. }
  74. .bg-olive-gradient {
  75. background-image: linear-gradient(45deg, #90e630, #39d266) !important;
  76. color: $white !important;
  77. }
  78. .bg-grey-gradient {
  79. background-image: linear-gradient(45deg, #9aadb9, #354855) !important;
  80. color: $white !important;
  81. }
  82. .bg-brown-gradient {
  83. background-image: linear-gradient(45deg, #ca6f2e, #cb1413) !important;
  84. color: $white !important;
  85. }
  86. @each $color, $value in $grays {
  87. .bg-#{$color} {
  88. background-color: $value !important;
  89. color: #333333 !important;
  90. }
  91. }
  92. .bg-square {
  93. @include bg-square;
  94. }
  95. .bg-none {
  96. background: transparent !important;
  97. color: inherit !important;
  98. }
  99. [class*='bg-mask'] {
  100. position: relative;
  101. //background: transparent !important;
  102. color: #ffffff !important;
  103. > view,
  104. > text {
  105. position: relative;
  106. z-index: 1;
  107. color: #ffffff;
  108. }
  109. &::before {
  110. content: '';
  111. border-radius: inherit;
  112. width: 100%;
  113. height: 100%;
  114. @include position-center;
  115. background-color: rgba(0, 0, 0, 0.4);
  116. z-index: 0;
  117. }
  118. @at-root .bg-mask-80::before {
  119. background: rgba(0, 0, 0, 0.8) !important;
  120. }
  121. @at-root .bg-mask-50::before {
  122. background: rgba(0, 0, 0, 0.5) !important;
  123. }
  124. @at-root .bg-mask-20::before {
  125. background: rgba(0, 0, 0, 0.2) !important;
  126. }
  127. @at-root .bg-mask-top::before {
  128. background-color: rgba(0, 0, 0, 0);
  129. background-image: linear-gradient(rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.618), rgba(0, 0, 0, 0.01));
  130. }
  131. @at-root .bg-white-top {
  132. background-color: rgba(0, 0, 0, 0);
  133. background-image: linear-gradient(rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.3));
  134. }
  135. @at-root .bg-mask-bottom::before {
  136. background-color: rgba(0, 0, 0, 0);
  137. background-image: linear-gradient(rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.618), rgba(0, 0, 0, 1));
  138. }
  139. }
  140. .bg-img {
  141. background-size: cover;
  142. background-position: center;
  143. background-repeat: no-repeat;
  144. }
  145. [class*='bg-blur'] {
  146. position: relative;
  147. > view,
  148. > text {
  149. position: relative;
  150. z-index: 1;
  151. }
  152. &::before {
  153. content: '';
  154. width: 100%;
  155. height: 100%;
  156. @include position-center;
  157. border-radius: inherit;
  158. transform-origin: 0 0;
  159. pointer-events: none;
  160. box-sizing: border-box;
  161. }
  162. }
  163. @supports (-webkit-backdrop-filter: blur(20px)) or (backdrop-filter: blur(20px)) {
  164. .bg-blur::before {
  165. @include blur;
  166. background-color: var(--ui-Blur-1);
  167. }
  168. .bg-blur-1::before {
  169. @include blur;
  170. background-color: var(--ui-Blur-2);
  171. }
  172. .bg-blur-2::before {
  173. @include blur;
  174. background-color: var(--ui-Blur-3);
  175. }
  176. }
  177. @supports not (backdrop-filter: blur(5px)) {
  178. .bg-blur {
  179. color: var(--ui-TC);
  180. &::before {
  181. background-color: var(--ui-BG);
  182. }
  183. }
  184. .bg-blur-1 {
  185. color: var(--ui-TC);
  186. &::before {
  187. background-color: var(--ui-BG-1);
  188. }
  189. }
  190. .bg-blur-2 {
  191. color: var(--ui-TC);
  192. &::before {
  193. background-color: var(--ui-BG-2);
  194. }
  195. }
  196. }