layout.wxss 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. /* ==================
  2. 布局
  3. ==================== */
  4. /* -- flex弹性布局 -- */
  5. .flex {
  6. display: flex;
  7. }
  8. .basis-xs {
  9. flex-basis: 20%;
  10. }
  11. .basis-sm {
  12. flex-basis: 40%;
  13. }
  14. .basis-df {
  15. flex-basis: 50%;
  16. }
  17. .basis-lg {
  18. flex-basis: 60%;
  19. }
  20. .basis-xl {
  21. flex-basis: 80%;
  22. }
  23. .flex-sub {
  24. flex: 1;
  25. }
  26. .flex-twice {
  27. flex: 2;
  28. }
  29. .flex-treble {
  30. flex: 3;
  31. }
  32. .flex-direction {
  33. flex-direction: column;
  34. }
  35. .flex-wrap {
  36. flex-wrap: wrap;
  37. }
  38. .align-start {
  39. align-items: flex-start;
  40. }
  41. .align-end {
  42. align-items: flex-end;
  43. }
  44. .align-center {
  45. align-items: center;
  46. }
  47. .align-stretch {
  48. align-items: stretch;
  49. }
  50. .self-start {
  51. align-self: flex-start;
  52. }
  53. .self-center {
  54. align-self: flex-center;
  55. }
  56. .self-end {
  57. align-self: flex-end;
  58. }
  59. .self-stretch {
  60. align-self: stretch;
  61. }
  62. .align-stretch {
  63. align-items: stretch;
  64. }
  65. .justify-start {
  66. justify-content: flex-start;
  67. }
  68. .justify-end {
  69. justify-content: flex-end;
  70. }
  71. .justify-center {
  72. justify-content: center;
  73. }
  74. .justify-between {
  75. justify-content: space-between;
  76. }
  77. .justify-around {
  78. justify-content: space-around;
  79. }
  80. /* -- 内外边距 -- */
  81. .margin-0 {
  82. margin: 0;
  83. }
  84. .margin-xs {
  85. margin: 10rpx;
  86. }
  87. .margin-s {
  88. margin: 20rpx;
  89. }
  90. .margin {
  91. margin: 30rpx;
  92. }
  93. .margin-lg {
  94. margin: 40rpx;
  95. }
  96. .margin-xl {
  97. margin: 50rpx;
  98. }
  99. .margin-top-xs {
  100. margin-top: 10rpx;
  101. }
  102. .margin-top-s {
  103. margin-top: 20rpx;
  104. }
  105. .margin-top {
  106. margin-top: 30rpx;
  107. }
  108. .margin-top-l {
  109. margin-top: 40rpx;
  110. }
  111. .margin-top-xl {
  112. margin-top: 50rpx;
  113. }
  114. .margin-right-xxs {
  115. margin-right: 6rpx;
  116. }
  117. .margin-right-xs {
  118. margin-right: 10rpx;
  119. }
  120. .margin-right-s {
  121. margin-right: 20rpx;
  122. }
  123. .margin-right {
  124. margin-right: 30rpx;
  125. }
  126. .margin-right-l {
  127. margin-right: 40rpx;
  128. }
  129. .margin-right-xl {
  130. margin-right: 50rpx;
  131. }
  132. .margin-bottom-xxs {
  133. margin-bottom: 6rpx;
  134. }
  135. .margin-bottom-xs {
  136. margin-bottom: 10rpx;
  137. }
  138. .margin-bottom-s {
  139. margin-bottom: 20rpx;
  140. }
  141. .margin-bottom {
  142. margin-bottom: 30rpx;
  143. }
  144. .margin-bottom-l {
  145. margin-bottom: 40rpx;
  146. }
  147. .margin-bottom-xl {
  148. margin-bottom: 50rpx;
  149. }
  150. .margin-left-xs {
  151. margin-left: 10rpx;
  152. }
  153. .margin-left-s {
  154. margin-left: 20rpx;
  155. }
  156. .margin-left {
  157. margin-left: 30rpx;
  158. }
  159. .margin-left-l {
  160. margin-left: 40rpx;
  161. }
  162. .margin-left-xl {
  163. margin-left: 50rpx;
  164. }
  165. .padding-0 {
  166. padding: 0;
  167. }
  168. .padding-xs {
  169. padding: 10rpx;
  170. }
  171. .padding-s {
  172. padding: 20rpx;
  173. }
  174. .padding {
  175. padding: 30rpx;
  176. }
  177. .padding-l {
  178. padding: 40rpx;
  179. }
  180. .padding-xl {
  181. padding: 50rpx;
  182. }
  183. .padding-top-xs {
  184. padding-top: 10rpx;
  185. }
  186. .padding-top-s {
  187. padding-top: 20rpx;
  188. }
  189. .padding-top {
  190. padding-top: 30rpx;
  191. }
  192. .padding-top-l {
  193. padding-top: 40rpx;
  194. }
  195. .padding-top-xl {
  196. padding-top: 50rpx;
  197. }
  198. .padding-right-xs {
  199. padding-right: 10rpx;
  200. }
  201. .padding-right-s {
  202. padding-right: 20rpx;
  203. }
  204. .padding-right {
  205. padding-right: 30rpx;
  206. }
  207. .padding-right-l {
  208. padding-right: 40rpx;
  209. }
  210. .padding-right-xl {
  211. padding-right: 50rpx;
  212. }
  213. .padding-bottom-xs {
  214. padding-bottom: 10rpx;
  215. }
  216. .padding-bottom-s {
  217. padding-bottom: 20rpx;
  218. }
  219. .padding-bottom {
  220. padding-bottom: 30rpx;
  221. }
  222. .padding-bottom-l {
  223. padding-bottom: 40rpx;
  224. }
  225. .padding-bottom-xl {
  226. padding-bottom: 50rpx;
  227. }
  228. .padding-left-xs {
  229. padding-left: 10rpx;
  230. }
  231. .padding-left-s {
  232. padding-left: 20rpx;
  233. }
  234. .padding-left {
  235. padding-left: 30rpx;
  236. }
  237. .padding-left-l {
  238. padding-left: 40rpx;
  239. }
  240. .padding-left-xl {
  241. padding-left: 50rpx;
  242. }
  243. /* grid布局 */
  244. .grid {
  245. display: flex;
  246. flex-wrap: wrap;
  247. }
  248. .grid.grid-square {
  249. overflow: hidden;
  250. }
  251. .grid.grid-square .cu-tag {
  252. position: absolute;
  253. right: 0;
  254. top: 0;
  255. border-bottom-left-radius: 6rpx;
  256. padding: 6rpx 12rpx;
  257. height: auto;
  258. background-color: rgba(0, 0, 0, 0.5);
  259. }
  260. .grid.grid-square>view>text[class*="cuIcon-"] {
  261. font-size: 52rpx;
  262. position: absolute;
  263. color: var(--grey);
  264. margin: auto;
  265. top: 0;
  266. bottom: 0;
  267. left: 0;
  268. right: 0;
  269. display: flex;
  270. justify-content: center;
  271. align-items: center;
  272. flex-direction: column;
  273. }
  274. .grid.grid-square>view {
  275. margin-right: 20rpx;
  276. margin-bottom: 20rpx;
  277. border-radius: 6rpx;
  278. position: relative;
  279. overflow: hidden;
  280. }
  281. .grid.grid-square>view.bg-img image {
  282. width: 100%;
  283. height: 100%;
  284. position: absolute;
  285. }
  286. .grid.col-1.grid-square>view {
  287. padding-bottom: 100%;
  288. height: 0;
  289. margin-right: 0;
  290. }
  291. .grid.col-2.grid-square>view {
  292. padding-bottom: calc((100% - 20rpx)/2);
  293. height: 0;
  294. width: calc((100% - 20rpx)/2);
  295. }
  296. .grid.col-3.grid-square>view {
  297. padding-bottom: calc((100% - 40rpx)/3);
  298. height: 0;
  299. width: calc((100% - 40rpx)/3);
  300. }
  301. .grid.col-4.grid-square>view {
  302. padding-bottom: calc((100% - 60rpx)/4);
  303. height: 0;
  304. width: calc((100% - 60rpx)/4);
  305. }
  306. .grid.col-5.grid-square>view {
  307. padding-bottom: calc((100% - 80rpx)/5);
  308. height: 0;
  309. width: calc((100% - 80rpx)/5);
  310. }
  311. .grid.col-2.grid-square>view:nth-child(2n),
  312. .grid.col-3.grid-square>view:nth-child(3n),
  313. .grid.col-4.grid-square>view:nth-child(4n),
  314. .grid.col-5.grid-square>view:nth-child(5n){
  315. margin-right: 0;
  316. }
  317. .grid.col-1>view {
  318. width: 100%;
  319. }
  320. .grid.col-2>view {
  321. width: 50%;
  322. }
  323. .grid.col-3>view {
  324. width: 33.33%;
  325. }
  326. .grid.col-4>view {
  327. width: 25%;
  328. }
  329. .grid.col-5>view {
  330. width: 20%;
  331. }