common.scss 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. /* 颜色 */
  2. .bg{
  3. background-color: $bg;
  4. }
  5. .blue{
  6. color: $blue;
  7. }
  8. .blue-1{
  9. color: $blue-1;
  10. }
  11. .bg-blue{
  12. background-color: $blue;
  13. }
  14. .bg-purple{
  15. background-color: $purple;
  16. }
  17. .bg-red{
  18. background-color: $red;
  19. }
  20. .bg-white{
  21. background-color: $white;
  22. }
  23. .purple{
  24. color: $purple;
  25. }
  26. .red{
  27. color: $red;
  28. }
  29. .white{
  30. color:$white;
  31. }
  32. .gray{
  33. color:$gray;
  34. }
  35. .gray-1{
  36. color:$gray-1;
  37. }
  38. .gray-2{
  39. color:$gray-2;
  40. }
  41. .bg-gray-2{
  42. background-color:$gray-2;
  43. }
  44. // padding margin
  45. @for $value from 1 through 100{
  46. .pd-#{$value}, .ptb-#{$value}, .pt-#{$value} { padding-top: $value*1rpx; }
  47. .pd-#{$value}, .ptb-#{$value}, .pb-#{$value} { padding-bottom: $value*1rpx; }
  48. .pd-#{$value}, .plr-#{$value}, .pl-#{$value} { padding-left: $value*1rpx; }
  49. .pd-#{$value}, .plr-#{$value}, .pr-#{$value} { padding-right: $value*1rpx; }
  50. .mg-#{$value}, .mtb-#{$value}, .mt-#{$value} { margin-top: $value*1rpx; }
  51. .mg-#{$value}, .mtb-#{$value}, .mb-#{$value} { margin-bottom: $value*1rpx; }
  52. .mg-#{$value}, .mlr-#{$value}, .ml-#{$value} { margin-left: $value*1rpx; }
  53. .mg-#{$value}, .mlr-#{$value}, .mr-#{$value} { margin-right: $value*1rpx; }
  54. }
  55. // size
  56. @for $value from 20 through 50{
  57. .size-#{$value}{ font-size: $value*1rpx; }
  58. }
  59. // radius
  60. .radius {
  61. border-radius: 50%;
  62. }
  63. @for $value from 5 through 50{
  64. .radius-#{$value}{ border-radius: $value*1rpx; }
  65. }
  66. /* flex */
  67. .center{
  68. display: flex;
  69. justify-content: center;
  70. align-items: center;
  71. }
  72. .flex{
  73. display: flex;
  74. justify-content: space-between;
  75. align-items: center;
  76. }
  77. .flex_l{
  78. display: flex;
  79. justify-content: flex-start;
  80. align-items: center;
  81. }
  82. .flex_r{
  83. display: flex;
  84. justify-content: flex-end;
  85. align-items: center;
  86. }
  87. .flex1{
  88. display: flex;
  89. }
  90. .flex-start{
  91. justify-content: flex-start;
  92. }
  93. .flex-end{
  94. justify-content: flex-end;
  95. }
  96. .flex-center{
  97. justify-content: center;
  98. }
  99. .flex-around{
  100. justify-content: space-around;
  101. }
  102. .flex-between{
  103. justify-content: space-between;
  104. }
  105. .flex-top{
  106. align-items: flex-start;
  107. }
  108. .flex-middle{
  109. align-items: center;
  110. }
  111. .flex-bottom{
  112. align-items: flex-end;
  113. }
  114. .flex-column{
  115. flex-direction: column;
  116. }
  117. .flex-wrap{
  118. flex-wrap: wrap;
  119. }
  120. /* 边框 */
  121. .border{
  122. border: $border-width-base solid $border-color;
  123. }
  124. .bt {
  125. border-top: $border-width-base solid $border-color;
  126. }
  127. .bb {
  128. border-bottom: $border-width-base solid $border-color;
  129. }
  130. .bl {
  131. border-left: $border-width-base solid $border-color;
  132. }
  133. .br {
  134. border-right: $border-width-base solid $border-color;
  135. }
  136. /* 全屏 */
  137. .vw100 {
  138. width: 100vw !important;
  139. }
  140. .vh100 {
  141. height: 100vh !important;
  142. }
  143. .min100 {
  144. min-height: 100vh !important;
  145. }
  146. .h100 {
  147. height: 100% !important;
  148. }
  149. .w100 {
  150. width: 100% !important;
  151. }
  152. /* 其他 */
  153. .relative{
  154. position: relative;
  155. }
  156. .absolute{
  157. position: absolute;
  158. }
  159. .fixed{
  160. position: fixed;
  161. }
  162. .fixed-bottom{
  163. position: fixed;
  164. bottom: 0;
  165. left: 0;
  166. right: 0;
  167. z-index: 99;
  168. }
  169. .block{
  170. display: block;
  171. }
  172. .hide {
  173. display: none;
  174. }
  175. .show {
  176. display: block;
  177. }
  178. .autowrap {
  179. word-wrap: break-word;
  180. word-break: normal;
  181. }
  182. .text-left {
  183. text-align: left;
  184. }
  185. .text-center {
  186. text-align: center;
  187. }
  188. .text-right {
  189. text-align: right;
  190. }
  191. .bold {
  192. font-weight: 700;
  193. }
  194. .over-hidden {
  195. overflow: hidden;
  196. }
  197. /* uview内置样式 */
  198. /* u-line-1,u-line-2 一行省略 */
  199. /* u-font-26 x>= 20 && x <= 40时,表现为rpx性质 */
  200. /*
  201. u-padding-x == u-p-x
  202. u-padding-left-x == u-p-l-x
  203. u-padding-top-x == u-p-t-x
  204. u-padding-right-x == u-p-r-x
  205. u-padding-bottom-x == u-p-b-x
  206. u-margin-x == u-m-x
  207. u-margin-left-x == u-m-l-x
  208. u-margin-top-x == u-m-t-x
  209. u-margin-right-x == u-m-r-x
  210. u-margin-bottom-x == u-m-b-x
  211. 取值范围:
  212. 1-80(可以等于80)之间的偶数(双数) 和 5的倍数
  213. */
  214. /*
  215. .u-flex-1 {
  216. flex: 1; 取值范围 1~12
  217. }
  218. */