common.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // 字体
  2. @for $i from 20 through 100{
  3. .fs#{$i} {
  4. font-size: #{$i}rpx;
  5. }
  6. }
  7. // 颜色
  8. @for $i from 0 through 9{
  9. .color#{$i} {
  10. color: #{$i}#{$i}#{$i};
  11. }
  12. }
  13. // padding
  14. @for $i from 1 through 100{
  15. .p#{$i} {
  16. padding: #{$i}rpx;
  17. }
  18. }
  19. @for $i from 1 through 100{
  20. .ptb#{$i} {
  21. padding-top: #{$i}rpx ;
  22. padding-bottom: #{$i}rpx ;
  23. }
  24. }
  25. @for $i from 1 through 100{
  26. .plr#{$i} {
  27. padding-left: #{$i}rpx;
  28. padding-right: #{$i}rpx;
  29. }
  30. }
  31. @for $i from 1 through 200{
  32. .pt#{$i} {
  33. padding-top: #{$i}rpx;
  34. }
  35. }
  36. @for $i from 1 through 100{
  37. .pl#{$i} {
  38. padding-left: #{$i}rpx;
  39. }
  40. }
  41. @for $i from 1 through 100{
  42. .pr#{$i} {
  43. padding-right: #{$i}rpx;
  44. }
  45. }
  46. @for $i from 1 through 200{
  47. .pb#{$i} {
  48. padding-bottom: #{$i}rpx;
  49. }
  50. }
  51. // margin
  52. @for $i from 1 through 100{
  53. .m#{$i} {
  54. margin: #{$i}rpx;
  55. }
  56. }
  57. @for $i from 1 through 100{
  58. .mtb#{$i} {
  59. margin-top: #{$i}rpx ;
  60. margin-bottom: #{$i}rpx ;
  61. }
  62. }
  63. @for $i from 1 through 100{
  64. .mlr#{$i} {
  65. margin-left: #{$i}rpx;
  66. margin-right: #{$i}rpx;
  67. }
  68. }
  69. @for $i from 1 through 100{
  70. .mt#{$i} {
  71. margin-top: #{$i}rpx;
  72. }
  73. }
  74. @for $i from 1 through 100{
  75. .ml#{$i} {
  76. margin-left: #{$i}rpx;
  77. }
  78. }
  79. @for $i from 1 through 100{
  80. .mr#{$i} {
  81. margin-right: #{$i}rpx;
  82. }
  83. }
  84. @for $i from 1 through 100{
  85. .mb#{$i} {
  86. margin-bottom: #{$i}rpx;
  87. }
  88. }
  89. // 圆角
  90. @for $i from 0 through 100{
  91. .radius#{$i} {
  92. border-radius: #{$i}rpx;
  93. }
  94. }
  95. // padding 左右+width自动计算
  96. @for $i from 10 through 60{
  97. .w-calc-#{$i} {
  98. width: calc(100% - #{$i*2}rpx);
  99. padding-left: #{$i}rpx;
  100. padding-right: #{$i}rpx;
  101. }
  102. }
  103. // gap
  104. @for $i from 1 through 100{
  105. .gap#{$i} {
  106. gap: #{$i}rpx;
  107. }
  108. }
  109. // 高
  110. @for $i from 1 through 900{
  111. .h#{$i} {
  112. height: #{$i}rpx;
  113. }
  114. }
  115. // 宽
  116. @for $i from 1 through 900{
  117. .w#{$i} {
  118. width: #{$i}rpx;
  119. }
  120. }
  121. // 宽
  122. @for $i from 1 through 900{
  123. .lh#{$i} {
  124. line-height: #{$i}rpx;
  125. }
  126. }
  127. // font-weight
  128. $steps: 100 200 300 400 500 600 700 800 bold;
  129. @each $i in $steps {
  130. .weight-#{$i} {
  131. font-weight: $i;
  132. }
  133. }