common.scss 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. @mixin colBox($isBtw) {
  2. display: flex;
  3. flex-direction: column;
  4. @if $isBtw {
  5. justify-content: space-between;
  6. }
  7. }
  8. @mixin centerBox {
  9. display: flex;
  10. justify-content: center;
  11. align-items: center;
  12. }
  13. @mixin vCenterBox {
  14. display: flex;
  15. align-items: center;
  16. }
  17. @mixin btwBox {
  18. display: flex;
  19. justify-content: space-between;
  20. align-items: center;
  21. }
  22. @mixin nomalEllipsis {
  23. overflow: hidden;
  24. text-overflow: ellipsis;
  25. word-break: break-all;
  26. white-space: nowrap;
  27. }
  28. @mixin ellipsisWithLine($line) {
  29. display: -webkit-box;
  30. -webkit-box-orient: vertical;
  31. -webkit-line-clamp: $line;
  32. overflow: hidden;
  33. word-break: break-all;
  34. }
  35. // 字体
  36. @for $i from 20 through 100{
  37. .fs#{$i} {
  38. font-size: #{$i}rpx;
  39. }
  40. }
  41. // 颜色
  42. @for $i from 0 through 9{
  43. .color#{$i} {
  44. color: #{$i}#{$i}#{$i};
  45. }
  46. }
  47. // padding
  48. @for $i from 1 through 100{
  49. .p#{$i} {
  50. padding: #{$i}rpx;
  51. }
  52. }
  53. @for $i from 1 through 100{
  54. .ptb#{$i} {
  55. padding-top: #{$i}rpx ;
  56. padding-bottom: #{$i}rpx ;
  57. }
  58. }
  59. @for $i from 1 through 100{
  60. .plr#{$i} {
  61. padding-left: #{$i}rpx;
  62. padding-right: #{$i}rpx;
  63. }
  64. }
  65. @for $i from 1 through 200{
  66. .pt#{$i} {
  67. padding-top: #{$i}rpx;
  68. }
  69. }
  70. @for $i from 1 through 100{
  71. .pl#{$i} {
  72. padding-left: #{$i}rpx;
  73. }
  74. }
  75. @for $i from 1 through 100{
  76. .pr#{$i} {
  77. padding-right: #{$i}rpx;
  78. }
  79. }
  80. @for $i from 1 through 200{
  81. .pb#{$i} {
  82. padding-bottom: #{$i}rpx;
  83. }
  84. }
  85. // margin
  86. @for $i from 1 through 100{
  87. .m#{$i} {
  88. margin: #{$i}rpx;
  89. }
  90. }
  91. @for $i from 1 through 100{
  92. .mtb#{$i} {
  93. margin-top: #{$i}rpx ;
  94. margin-bottom: #{$i}rpx ;
  95. }
  96. }
  97. @for $i from 1 through 100{
  98. .mlr#{$i} {
  99. margin-left: #{$i}rpx;
  100. margin-right: #{$i}rpx;
  101. }
  102. }
  103. @for $i from 1 through 100{
  104. .mt#{$i} {
  105. margin-top: #{$i}rpx;
  106. }
  107. }
  108. @for $i from 1 through 100{
  109. .ml#{$i} {
  110. margin-left: #{$i}rpx;
  111. }
  112. }
  113. @for $i from 1 through 100{
  114. .mr#{$i} {
  115. margin-right: #{$i}rpx;
  116. }
  117. }
  118. @for $i from 1 through 100{
  119. .mb#{$i} {
  120. margin-bottom: #{$i}rpx;
  121. }
  122. }
  123. // 圆角
  124. @for $i from 0 through 100{
  125. .radius#{$i} {
  126. border-radius: #{$i}rpx;
  127. }
  128. }
  129. // padding 左右+width自动计算
  130. @for $i from 10 through 60{
  131. .w-calc-#{$i} {
  132. width: calc(100% - #{$i*2}rpx);
  133. padding-left: #{$i}rpx;
  134. padding-right: #{$i}rpx;
  135. }
  136. }
  137. // gap
  138. @for $i from 1 through 100{
  139. .gap#{$i} {
  140. gap: #{$i}rpx;
  141. }
  142. }
  143. // 高
  144. @for $i from 1 through 900{
  145. .h#{$i} {
  146. height: #{$i}rpx;
  147. }
  148. }
  149. // 宽
  150. @for $i from 1 through 900{
  151. .w#{$i} {
  152. width: #{$i}rpx;
  153. }
  154. }
  155. // 宽
  156. @for $i from 1 through 900{
  157. .lh#{$i} {
  158. line-height: #{$i}rpx;
  159. }
  160. }
  161. // font-weight
  162. $steps: 100 200 300 400 500 600 700 800 bold;
  163. @each $i in $steps {
  164. .weight-#{$i} {
  165. font-weight: $i;
  166. }
  167. }
  168. .bold {
  169. font-weight: bold;
  170. }
  171. .scrollx {
  172. overflow-x: scroll;
  173. }
  174. .scrolly {
  175. overflow-y: scroll;
  176. }
  177. .color9{
  178. color: #999;
  179. }
  180. .color6{
  181. color: #666;
  182. }
  183. .bgf{
  184. background-color: #fff;
  185. }
  186. .base-color{
  187. color: #018C39;
  188. }
  189. .colorf {
  190. color: #fff;
  191. }
  192. .bgf {
  193. background: #fff;
  194. }
  195. .fixed {
  196. position: fixed;
  197. }
  198. .absolute {
  199. position: absolute;
  200. }
  201. .relative {
  202. position: relative;
  203. }
  204. .w100 {
  205. width: 100%;
  206. }
  207. .h100 {
  208. height: 100%;
  209. }
  210. .card {
  211. background: #fff;
  212. border-radius: 15rpx;
  213. }
  214. .cover-height {
  215. height: 100%;
  216. display: flex;
  217. flex-direction: column;
  218. box-sizing: border-box;
  219. }
  220. .row {
  221. display: flex;
  222. flex-direction: row;
  223. }
  224. .column {
  225. display: flex;
  226. flex-direction: column;
  227. }
  228. .justify-start {
  229. display: flex;
  230. justify-content: flex-start;
  231. }
  232. .justify-center {
  233. display: flex;
  234. justify-content: center;
  235. }
  236. .justify-end {
  237. display: flex;
  238. justify-content: flex-end;
  239. }
  240. .justify-around {
  241. display: flex;
  242. justify-content: space-around;
  243. }
  244. .justify-evenly {
  245. display: flex;
  246. justify-content: space-evenly;
  247. }
  248. .justify-between {
  249. display: flex;
  250. justify-content: space-between;
  251. }
  252. .align-start {
  253. display: flex;
  254. align-items: flex-start;
  255. }
  256. .align-center {
  257. display: flex;
  258. align-items: center;
  259. }
  260. .align-end {
  261. display: flex;
  262. align-items: flex-end;
  263. }
  264. .center {
  265. display: flex;
  266. justify-content: center;
  267. align-items: center;
  268. }
  269. .centerV {
  270. display: flex;
  271. justify-content: center;
  272. align-items: center;
  273. flex-direction: column;
  274. }
  275. .wrap {
  276. flex-wrap: wrap;
  277. }
  278. .flex-1 {
  279. flex: 1;
  280. }
  281. .ellipsis {
  282. overflow: hidden;
  283. text-overflow: ellipsis;
  284. display: -webkit-box;
  285. -webkit-box-orient: vertical;
  286. box-sizing: border-box;
  287. width: 100%;
  288. -webkit-line-clamp: 1;
  289. }
  290. .lines-2 {
  291. -webkit-line-clamp: 2 !important;
  292. }
  293. .lines-3 {
  294. -webkit-line-clamp: 3 !important;
  295. }
  296. .bold {
  297. font-weight: bold;
  298. }
  299. .line-through {
  300. text-decoration: line-through;
  301. }
  302. .nowrap {
  303. white-space: nowrap;
  304. }
  305. .scrollx {
  306. overflow-x: scroll;
  307. }
  308. .scrolly {
  309. overflow-y: scroll;
  310. }
  311. .cvauto {
  312. content-visibility: auto;
  313. }