global.scss 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. $font-size0: 20;
  2. $step: 2;
  3. $dirlist: top,
  4. bottom,
  5. left,
  6. right;
  7. $colors: (
  8. theme,
  9. $color-theme),
  10. (white, $color-white),
  11. (money, $color-money),
  12. (green, $color-green),
  13. (1, $color-1),
  14. (2, $color-2),
  15. (3, $color-3),
  16. (4, $color-4),
  17. (line, $color-line),
  18. (mask, $color-mask
  19. );
  20. .color-white2 {
  21. color: rgba($color: #fff, $alpha: 0.8);
  22. }
  23. @each $name,
  24. $color in $colors {
  25. .color-#{"" + $name} {
  26. color: $color;
  27. }
  28. .bgcolor-#{"" + $name} {
  29. background-color: $color;
  30. }
  31. }
  32. .bgcolor-transparent {
  33. background: transparent !important;
  34. }
  35. /*! font-size */
  36. .font-size-inherit {
  37. font-size: inherit;
  38. }
  39. @for $i from 0 through 20 {
  40. .font#{$i} {
  41. font-size: ($font-size0 + $i * $step)+#{$unit};
  42. }
  43. }
  44. .marginXauto {
  45. margin-left: auto;
  46. margin-right: auto;
  47. }
  48. $i: 50;
  49. @while $i>-1 {
  50. .marginL#{$i} {
  51. margin-left: #{$i * $step}#{$unit};
  52. }
  53. .marginR#{$i} {
  54. margin-right: #{$i * $step}#{$unit};
  55. }
  56. .marginT#{$i} {
  57. margin-top: #{$i * $step}#{$unit};
  58. }
  59. .marginB#{$i} {
  60. margin-bottom: #{$i * $step}#{$unit};
  61. }
  62. .marginY#{$i} {
  63. margin-top: #{$i * $step}#{$unit};
  64. margin-bottom: #{$i * $step}#{$unit};
  65. }
  66. .marginX#{$i} {
  67. margin-left: #{$i * $step}#{$unit};
  68. margin-right: #{$i * $step}#{$unit};
  69. }
  70. .margin#{$i} {
  71. margin: #{$i * $step}#{$unit};
  72. }
  73. .paddingL#{$i} {
  74. padding-left: #{$i * $step}#{$unit};
  75. }
  76. .paddingR#{$i} {
  77. padding-right: #{$i * $step}#{$unit};
  78. }
  79. .paddingT#{$i} {
  80. padding-top: #{$i * $step}#{$unit};
  81. }
  82. .paddingB#{$i} {
  83. padding-bottom: #{$i * $step}#{$unit};
  84. }
  85. .paddingY#{$i} {
  86. padding-top: #{$i * $step}#{$unit};
  87. padding-bottom: #{$i * $step}#{$unit};
  88. }
  89. .paddingX#{$i} {
  90. padding-left: #{$i * $step}#{$unit};
  91. padding-right: #{$i * $step}#{$unit};
  92. }
  93. .padding#{$i} {
  94. padding: #{$i * $step}#{$unit};
  95. }
  96. $i: $i - 1;
  97. }
  98. .padding0force {
  99. padding: 0 !important;
  100. }
  101. .margin0force {
  102. margin: 0 !important;
  103. }
  104. /*! opacity */
  105. $i: 10;
  106. @while $i>=0 {
  107. .opacity_#{$i} {
  108. opacity: 0.1 * $i;
  109. }
  110. $i: $i - 1;
  111. }
  112. /*! border */
  113. .border-none {
  114. border: none;
  115. }
  116. .border1 {
  117. border: #{1}#{$unit} solid $color-line;
  118. }
  119. .border1theme {
  120. border: #{1}#{$unit} solid $color-theme;
  121. }
  122. .border1white {
  123. border: #{1}#{$unit} solid $color-white;
  124. }
  125. .border1-transparent {
  126. border: #{1}#{$unit} solid transparent;
  127. }
  128. @each $dir in $dirlist {
  129. .border-#{$dir}1 {
  130. border-#{$dir}: #{1}#{$unit} solid $color-line;
  131. }
  132. .border-#{$dir}-dash {
  133. border-#{$dir}: #{1}#{$unit} dashed $color-line;
  134. }
  135. }
  136. /*! border-radius */
  137. .border-radius50 {
  138. border-radius: 50%;
  139. }
  140. .border-radius100 {
  141. border-radius: 100%;
  142. }
  143. $i: 20;
  144. @while $i>-1 {
  145. .radius#{$i} {
  146. border-radius: #{$i * $step}#{$unit};
  147. }
  148. $i: $i - 1;
  149. }
  150. /*! float */
  151. .float-left {
  152. float: left;
  153. }
  154. .float-right {
  155. float: right;
  156. }
  157. /*! width */
  158. .width25 {
  159. width: 25%;
  160. }
  161. .width33 {
  162. width: 33.3%;
  163. }
  164. .width50 {
  165. width: 50%;
  166. }
  167. .width100 {
  168. width: 100%;
  169. }
  170. /*! height */
  171. .height100 {
  172. height: 100%;
  173. }
  174. /*! display */
  175. .block {
  176. display: block;
  177. }
  178. .inline-block {
  179. display: inline-block;
  180. }
  181. .display-none {
  182. display: none;
  183. }
  184. /*! position */
  185. .relative {
  186. position: relative;
  187. }
  188. .absolute {
  189. position: absolute;
  190. }
  191. .fixed {
  192. position: fixed;
  193. }
  194. .translateX {
  195. left: 50%;
  196. transform: translateX(-50%);
  197. }
  198. .translateY {
  199. top: 50%;
  200. transform: translateY(-50%);
  201. }
  202. .translateXY {
  203. left: 50%;
  204. top: 50%;
  205. transform: translate(-50%, -50%);
  206. }
  207. /*! text-align */
  208. .text-center {
  209. text-align: center;
  210. }
  211. .text-left {
  212. text-align: left;
  213. }
  214. .text-right {
  215. text-align: right;
  216. }
  217. .line-through {
  218. text-decoration: line-through;
  219. }
  220. .underline {
  221. text-decoration: underline !important;
  222. }
  223. /*! flex */
  224. .flex {
  225. display: flex;
  226. }
  227. .flex1 {
  228. flex: 1
  229. }
  230. .flex-center {
  231. display: flex;
  232. justify-content: center;
  233. }
  234. .flex-align {
  235. display: flex;
  236. align-items: center;
  237. }
  238. .flex-align-center {
  239. display: flex;
  240. align-items: center;
  241. justify-content: center;
  242. }
  243. .scroll-dx {
  244. overflow-x: auto;
  245. overflow-y: hidden;
  246. }
  247. .flex-align-start {
  248. display: flex;
  249. justify-content: flex-start;
  250. align-content: center;
  251. }
  252. .flex-center-start {
  253. display: flex;
  254. align-items: center;
  255. justify-content: flex-start;
  256. }
  257. .flex-align-end {
  258. display: flex;
  259. justify-content: flex-end;
  260. @extend .flex-align;
  261. }
  262. .flex-baseline {
  263. display: flex;
  264. align-items: baseline;
  265. }
  266. .flex-around {
  267. display: flex;
  268. justify-content: space-around;
  269. }
  270. .flex-between {
  271. display: flex;
  272. justify-content: space-between;
  273. }
  274. .flex-align-around {
  275. @extend .flex-align;
  276. @extend .flex-around;
  277. }
  278. .flex-align-between {
  279. @extend .flex-align;
  280. @extend .flex-between;
  281. }
  282. .flex-baseline-around {
  283. @extend .flex-baseline;
  284. @extend .flex-around;
  285. }
  286. .flex-baseline-between {
  287. @extend .flex-baseline;
  288. @extend .flex-between;
  289. }
  290. .flex-nowrap {
  291. display: flex;
  292. flex-wrap: nowrap;
  293. }
  294. .flex-wrap {
  295. display: flex;
  296. flex-wrap: wrap;
  297. }
  298. .flex-column {
  299. display: flex;
  300. flex-direction: column;
  301. }
  302. .flex-column-between {
  303. @extend .flex-column;
  304. justify-content: space-between;
  305. }
  306. .flex-column-around {
  307. @extend .flex-column;
  308. justify-content: space-around;
  309. }
  310. .flex-column-align {
  311. @extend .flex-column;
  312. justify-content: center;
  313. }
  314. .flex-column-align-center {
  315. @extend .flex-column-align;
  316. align-items: center;
  317. }
  318. .flex-column-center {
  319. @extend .flex-column;
  320. align-items: center;
  321. }
  322. .itemflex-00auto {
  323. flex: 0 0 auto;
  324. }
  325. .itemflex-11auto {
  326. flex: 1 1 auto;
  327. }
  328. .flex-shrink0 {
  329. flex-shrink: 0;
  330. }
  331. .self-stretch {
  332. align-self: stretch;
  333. }
  334. /*! word-break */
  335. .break-all {
  336. word-break: break-all;
  337. }
  338. .break-word {
  339. word-break: break-word;
  340. }
  341. /* white-space */
  342. .pre-wrap {
  343. white-space: pre-wrap;
  344. }
  345. .nowrap {
  346. white-space: nowrap;
  347. }
  348. /*! scroll */
  349. .scroll-x {
  350. overflow-x: scroll;
  351. }
  352. .scroll-y {
  353. overflow-y: scroll;
  354. }
  355. .scroll-auto {
  356. overflow: auto;
  357. }
  358. .overflow-hidden {
  359. overflow: hidden;
  360. }
  361. .line-ellipsis {
  362. white-space: nowrap;
  363. overflow: hidden;
  364. text-overflow: ellipsis;
  365. }
  366. /*! other */
  367. .bold {
  368. font-weight: bold;
  369. }
  370. .oblique {
  371. font-style: oblique
  372. }
  373. .clear {
  374. overflow: hidden;
  375. }
  376. .clear-both {
  377. clear: both;
  378. }
  379. .visibility-visible {
  380. visibility: visible;
  381. }
  382. .visibility-hidden {
  383. visibility: hidden;
  384. }
  385. .padding-bottom-save {
  386. padding-bottom: env(safe-area-inset-bottom);
  387. }
  388. .padding-bottom-tabbar {
  389. padding-bottom: calc(128rpx + env(safe-area-inset-bottom))
  390. }
  391. .btn.button-hover {
  392. transform: translate(1rpx, 1rpx);
  393. }
  394. .btn-clear {
  395. background: transparent;
  396. line-height: normal;
  397. &::after {
  398. border: 0 !important;
  399. }
  400. }
  401. .btn-clear::after {
  402. border: none
  403. }
  404. .bottom-fixed {
  405. position: fixed;
  406. left: 0;
  407. right: 0;
  408. bottom: 0;
  409. }
  410. .bgcolor-linear1 {
  411. background: linear-gradient(270deg, #d070ff 0%, #8b3dff 100%)
  412. }
  413. .cm-btn {
  414. @extend .flex-align-center;
  415. @extend .bgcolor-linear1;
  416. color: #fff;
  417. padding: 0;
  418. margin: 0;
  419. line-height: normal;
  420. &::after {
  421. border: 0 !important;
  422. }
  423. &.button-hover {
  424. transform: translate(1rpx, 1rpx);
  425. }
  426. &.cm-size {
  427. height: 96rpx;
  428. border-radius: 48rpx;
  429. font-size: 30rpx;
  430. }
  431. &.disabled {
  432. background: #F0F0F0;
  433. box-shadow: none;
  434. color: #999999;
  435. }
  436. &.no-shadow {
  437. box-shadow: none !important;
  438. }
  439. }
  440. .cm-plain-btn {
  441. @extend .flex-align-center;
  442. color: $color-theme;
  443. background: transparent;
  444. border: 2rpx solid $color-theme;
  445. padding: 0;
  446. margin: 0;
  447. line-height: normal;
  448. &::after {
  449. border: 0 !important;
  450. }
  451. &.button-hover {
  452. transform: translate(1rpx, 1rpx);
  453. }
  454. &.cm-size {
  455. height: 64rpx;
  456. border-radius: 48rpx;
  457. font-size: 28rpx;
  458. }
  459. &.info {
  460. color: #000;
  461. border: 2rpx solid #D8D8D8;
  462. }
  463. }