custom.scss 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. ///* flex布局 */
  2. .flex {
  3. display: flex;
  4. }
  5. .flex-inline {
  6. display: inline-flex;
  7. }
  8. .flex-auto {
  9. flex: 1;
  10. overflow: hidden;
  11. }
  12. .flex-center {
  13. @extend .flex;
  14. flex-direction: column;
  15. width: 100%;
  16. overflow: hidden;
  17. align-items: center;
  18. justify-content: center;
  19. align-content: center;
  20. }
  21. .flex-margin {
  22. margin: auto;
  23. }
  24. .flex-warp {
  25. display: flex;
  26. flex-wrap: wrap;
  27. align-content: flex-start;
  28. margin: 0 -5px;
  29. .flex-warp-item {
  30. padding: 5px;
  31. .flex-warp-item-box {
  32. width: 100%;
  33. height: 100%;
  34. }
  35. }
  36. }
  37. .flex-just-between {
  38. justify-content: space-between;
  39. }
  40. .flex-just-around {
  41. justify-content: space-around;
  42. }
  43. .flex-justify-center {
  44. justify-content: center;
  45. }
  46. .flex-align-items-center {
  47. align-items: center;
  48. align-content: center;
  49. }
  50. .flex-just-end {
  51. justify-content: flex-end;
  52. }
  53. .w50 {
  54. width: 50% !important;
  55. }
  56. .w100 {
  57. width: 100% !important;
  58. }
  59. .h100 {
  60. height: 100% !important;
  61. }
  62. .vh100 {
  63. height: 100vh !important;
  64. }
  65. /* 字体大小全局样式
  66. ------------------------------- */
  67. @for $i from 10 through 32 {
  68. .font#{$i} {
  69. font-size: #{$i}px !important;
  70. }
  71. }
  72. /* 外边距、内边距全局样式
  73. ------------------------------- */
  74. @for $i from 1 through 20 {
  75. .mt#{$i} {
  76. margin-top: #{$i}px !important;
  77. }
  78. .mr#{$i} {
  79. margin-right: #{$i}px !important;
  80. }
  81. .mb#{$i} {
  82. margin-bottom: #{$i}px !important;
  83. }
  84. .ml#{$i} {
  85. margin-left: #{$i}px !important;
  86. }
  87. .pt#{$i} {
  88. padding-top: #{$i}px !important;
  89. }
  90. .pr#{$i} {
  91. padding-right: #{$i}px !important;
  92. }
  93. .pb#{$i} {
  94. padding-bottom: #{$i}px !important;
  95. }
  96. .pl#{$i} {
  97. padding-left: #{$i}px !important;
  98. }
  99. .pv#{$i} {
  100. padding: #{$i}px auto !important;
  101. }
  102. .ph#{$i} {
  103. padding: auto #{$i}px !important;
  104. }
  105. .pd#{$i} {
  106. padding: #{$i}px !important;
  107. }
  108. .mv#{$i} {
  109. margin: #{$i}px auto !important;
  110. }
  111. .mh#{$i} {
  112. margin: auto #{$i}px !important;
  113. }
  114. .mg#{$i} {
  115. margin: #{$i}px #{$i}px !important;
  116. }
  117. }
  118. @for $i from 2 to 100 {
  119. .fs-#{$i} {
  120. font-size: #{$i}rpx;
  121. }
  122. .lh-#{$i} {
  123. line-height: #{$i}rpx;
  124. }
  125. }
  126. .fs-0 {
  127. font-size: 0px;
  128. }
  129. .fw-500 {
  130. font-weight: 500;
  131. }
  132. .fw-600 {
  133. font-weight: 600;
  134. }
  135. .fw-bold {
  136. font-weight: bold;
  137. }
  138. .lh-0 {
  139. line-height: 0px;
  140. }
  141. .lh-normal {
  142. line-height: normal;
  143. }
  144. .text-center {
  145. text-align: center;
  146. }
  147. $position: top, right, bottom, left;
  148. @each $item in $position {
  149. .m#{str-slice($item, 0, 1)}-auto {
  150. margin-#{$item}: auto;
  151. }
  152. .m#{str-slice($item, 0, 1)}-0 {
  153. margin-#{$item}: 0px;
  154. }
  155. }
  156. @for $i from 2 to 100 {
  157. @each $item in $position {
  158. .m#{str-slice($item, 0, 1)}-#{$i} {
  159. margin-#{$item}: #{$i}rpx;
  160. }
  161. .p#{str-slice($item, 0, 1)}-#{$i} {
  162. padding-#{$item}: #{$i}rpx;
  163. }
  164. }
  165. .height-#{$i} {
  166. height: #{$i}rpx;
  167. }
  168. .width-#{$i} {
  169. width: #{$i}rpx;
  170. }
  171. .br-#{$i} {
  172. border-radius: #{$i}rpx;
  173. }
  174. }
  175. .br-round {
  176. border-radius: 50%;
  177. }
  178. .mb-0 {
  179. margin-bottom: 0px;
  180. }
  181. .ml-auto {
  182. margin-left: auto;
  183. }
  184. .mt-auto {
  185. margin-top: auto;
  186. }
  187. .width-168 {
  188. width: 168rpx;
  189. }
  190. .width-half {
  191. width: 50%;
  192. }