style.scss 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. @import "./variables";
  2. // 全局样式
  3. * {
  4. margin: 0;
  5. padding: 0;
  6. list-style-type: none;
  7. box-sizing: border-box;
  8. outline: none;
  9. }
  10. html {
  11. margin: 0;
  12. padding: 0;
  13. }
  14. body {
  15. font-family: Arial, Helvetica, sans-serif;
  16. line-height: 1.2em;
  17. background-color: #f1f1f1;
  18. margin: 0;
  19. padding: 0;
  20. overflow: hidden;
  21. }
  22. a {
  23. color: #343440;
  24. text-decoration: none;
  25. box-sizing: border-box;
  26. }
  27. .clearfix {
  28. &::after {
  29. content: "";
  30. display: table;
  31. height: 0;
  32. line-height: 0;
  33. visibility: hidden;
  34. clear: both;
  35. }
  36. }
  37. // 图标
  38. .iconfont {
  39. font-size: 20px!important;
  40. color: #5cd9e8;
  41. }
  42. //浮动
  43. .float-r {
  44. float: right;
  45. }
  46. //浮动
  47. .float-l {
  48. float: left;
  49. }
  50. // 字体加粗
  51. .fw-b {
  52. font-weight: bold;
  53. }
  54. //文章一行显示,多余省略号显示
  55. .title-item {
  56. overflow: hidden;
  57. text-overflow: ellipsis;
  58. white-space: nowrap;
  59. }
  60. .bg-color-black {
  61. background-color: rgba(19, 25, 47, 0.6);
  62. }
  63. .bg-color-blue {
  64. background-color: #1a5cd7;
  65. }
  66. .colorBlack {
  67. color: #272727 !important;
  68. &:hover {
  69. color: #272727 !important;
  70. }
  71. }
  72. .colorGrass {
  73. color: #33cea0;
  74. &:hover {
  75. color: #33cea0 !important;
  76. }
  77. }
  78. .colorRed {
  79. color: #ff5722;
  80. &:hover {
  81. color: #ff5722 !important;
  82. }
  83. }
  84. .colorText {
  85. color: #d3d6dd !important;
  86. &:hover {
  87. color: #d3d6dd !important;
  88. }
  89. }
  90. .colorBlue {
  91. color: #257dff !important;
  92. &:hover {
  93. color: #257dff !important;
  94. }
  95. }
  96. //颜色
  97. @each $colorkey, $color in $colors {
  98. .text-#{$colorkey} {
  99. color: $color;
  100. }
  101. .bg-#{$colorkey} {
  102. background-color: $color;
  103. }
  104. }
  105. //对齐
  106. @each $var in (left, center, right) {
  107. .text-#{$var} {
  108. text-align: $var !important;
  109. }
  110. }
  111. //flex
  112. @each $key, $value in $flex-jc {
  113. .jc-#{$key} {
  114. justify-content: $value;
  115. }
  116. }
  117. @each $key, $value in $flex-ai {
  118. .ai-#{$key} {
  119. align-items: $value;
  120. }
  121. }
  122. //字体
  123. @each $fontkey, $fontvalue in $font-sizes {
  124. .fs-#{$fontkey} {
  125. font-size: $fontvalue * $base-font-size;
  126. }
  127. }
  128. //.mt-1 => margin top
  129. //spacing
  130. @each $typekey, $type in $spacing-types {
  131. //.m-1
  132. @each $sizekey, $size in $spacing-sizes {
  133. .#{$typekey}-#{$sizekey} {
  134. #{$type}: $size * $spacing-base-size;
  135. }
  136. }
  137. //.mx-1
  138. @each $sizekey, $size in $spacing-sizes {
  139. .#{$typekey}x-#{$sizekey} {
  140. #{$type}-left: $size * $spacing-base-size;
  141. #{$type}-right: $size * $spacing-base-size;
  142. }
  143. .#{$typekey}y-#{$sizekey} {
  144. #{$type}-top: $size * $spacing-base-size;
  145. #{$type}-bottom: $size * $spacing-base-size;
  146. }
  147. }
  148. //.mt-1
  149. @each $directionkey, $direction in $spacing-directions {
  150. @each $sizekey, $size in $spacing-sizes {
  151. .#{$typekey}#{$directionkey}-#{$sizekey} {
  152. #{$type}-#{$direction}: $size * $spacing-base-size;
  153. }
  154. }
  155. }
  156. .#{$typekey} {
  157. #{$type}: 0;
  158. }
  159. }