base.scss 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. @import "./builder.scss";
  2. page {
  3. /* 定义一些主题色及基础样式 */
  4. font-family: PingFang SC, Arial, Hiragino Sans GB, Microsoft YaHei, sans-serif;
  5. font-size: 28rpx;
  6. color: $-color-normal;
  7. padding-bottom: env(safe-area-inset-bottom);
  8. background-color: $-color-body;
  9. }
  10. .bold {
  11. font-weight: bold;
  12. }
  13. /* 定义字体颜色 */
  14. .primary {
  15. color: $-color-primary;
  16. }
  17. .bg-primary {
  18. background-color: $-color-primary;
  19. }
  20. .bg-white {
  21. background-color: $-color-white;
  22. }
  23. .bg-body {
  24. background-color: $-color-body;
  25. }
  26. .bg-gray {
  27. background-color: $-color-border;
  28. }
  29. .black {
  30. color: $-color-black;
  31. }
  32. .white {
  33. color: $-color-white;
  34. }
  35. .normal {
  36. color: $-color-normal;
  37. }
  38. .lighter {
  39. color: $-color-lighter;
  40. }
  41. .muted {
  42. color: $-color-muted;
  43. }
  44. /* 定义字体大小 */
  45. .xxl {
  46. font-size: 36rpx;
  47. }
  48. .xl {
  49. font-size: 34rpx;
  50. }
  51. .lg {
  52. font-size: 32rpx;
  53. }
  54. .md {
  55. font-size: 30rpx;
  56. }
  57. .nr {
  58. font-size: 28rpx;
  59. }
  60. .sm {
  61. font-size: 26rpx;
  62. }
  63. .xs {
  64. font-size: 24rpx;
  65. }
  66. .xxs {
  67. font-size: 22rpx;
  68. }
  69. /* 定义常用外边距 */
  70. .ml5 {
  71. margin-left: 5rpx;
  72. }
  73. .ml10 {
  74. margin-left: 10rpx;
  75. }
  76. .ml20 {
  77. margin-left: 20rpx;
  78. }
  79. .ml30 {
  80. margin-left: 30rpx;
  81. }
  82. .mr5 {
  83. margin-right: 5rpx;
  84. }
  85. .mr10 {
  86. margin-right: 10rpx;
  87. }
  88. .mr20 {
  89. margin-right: 20rpx;
  90. }
  91. .mr30 {
  92. margin-right: 30rpx;
  93. }
  94. .mt5 {
  95. margin-top: 5rpx;
  96. }
  97. .mt10 {
  98. margin-top: 10rpx;
  99. }
  100. .mt20 {
  101. margin-top: 20rpx;
  102. }
  103. .mt30 {
  104. margin-top: 30rpx;
  105. }
  106. .mb5 {
  107. margin-bottom: 5rpx;
  108. }
  109. .mb10 {
  110. margin-bottom: 10rpx;
  111. }
  112. .mb20 {
  113. margin-bottom: 20rpx;
  114. }
  115. .mb30 {
  116. margin-bottom: 30rpx;
  117. }
  118. /* 定义常用的弹性布局 */
  119. .flex1{
  120. flex:1;
  121. }
  122. .flexnone {
  123. flex: none;
  124. }
  125. .wrap {
  126. flex-wrap: wrap;
  127. }
  128. .row {
  129. display: flex;
  130. align-items: center;
  131. }
  132. .row-center {
  133. display: flex;
  134. align-items: center;
  135. justify-content: center;
  136. }
  137. .row-end {
  138. display: flex;
  139. align-items: center;
  140. justify-content: flex-end;
  141. }
  142. .row-between {
  143. display: flex;
  144. align-items: center;
  145. justify-content: space-between;
  146. }
  147. .row-around {
  148. display: flex;
  149. align-items: center;
  150. justify-content: space-around;
  151. }
  152. .column {
  153. display: flex;
  154. flex-direction: column;
  155. justify-content: center;
  156. }
  157. .column-center {
  158. display: flex;
  159. flex-direction: column;
  160. align-items: center;
  161. justify-content: center;
  162. }
  163. .column-around {
  164. display: flex;
  165. flex-direction: column;
  166. align-items: center;
  167. justify-content: space-around;
  168. }
  169. .column-end {
  170. display: flex;
  171. flex-direction: column;
  172. align-items: center;
  173. justify-content: flex-end;
  174. }
  175. .column-between {
  176. display: flex;
  177. flex-direction: column;
  178. align-items: center;
  179. justify-content: space-between;
  180. }
  181. /* 超出隐藏 */
  182. .line1 {
  183. overflow: hidden;
  184. text-overflow: ellipsis;
  185. white-space: nowrap;
  186. }
  187. .line2 {
  188. word-break: break-all;
  189. display: -webkit-box;
  190. -webkit-line-clamp: 2;
  191. -webkit-box-orient: vertical;
  192. overflow: hidden;
  193. }
  194. /* 中划线 */
  195. .line-through {
  196. text-decoration: line-through;
  197. }
  198. /* br60 */
  199. .br60 {
  200. border-radius: 60rpx;
  201. }
  202. /* 初始化按钮 */
  203. page button {
  204. padding: 0;
  205. margin: 0;
  206. background-color: transparent;
  207. font-weight: normal;
  208. font-size: 28rpx;
  209. overflow: unset;
  210. margin-left: 0;
  211. margin-right: 0;
  212. }
  213. page button::after {
  214. border: none;
  215. }
  216. button[type=primary] {
  217. background-color: $-color-primary;
  218. }
  219. .button-hover[type=primary] {
  220. background-color: $-color-primary;
  221. }
  222. button[disabled][type=primary] {
  223. background-color:$-color-primary;
  224. }
  225. /* 按钮大小 */
  226. button[size="xs"]{
  227. line-height: 58rpx;
  228. height: 58rpx;
  229. font-size: 26rpx;
  230. padding: 0 30rpx;
  231. }
  232. button[size="sm"] {
  233. line-height: 62rpx;
  234. height: 62rpx;
  235. font-size: 28rpx;
  236. padding: 0 30rpx;
  237. }
  238. button[size="md"]{
  239. line-height: 70rpx;
  240. height: 70rpx;
  241. font-size: 30rpx;
  242. padding: 0 30rpx;
  243. }
  244. button[size="lg"]{
  245. line-height: 80rpx;
  246. height: 80rpx;
  247. font-size: 32rpx;
  248. padding: 0 30rpx;
  249. }
  250. //******图标******/
  251. .icon-xs {
  252. @include icon-image(28rpx);
  253. }
  254. .icon-sm {
  255. @include icon-image(30rpx);
  256. }
  257. .icon {
  258. @include icon-image(34rpx);
  259. }
  260. .icon-md {
  261. @include icon-image(44rpx);
  262. }
  263. .icon-lg {
  264. @include icon-image(52rpx);
  265. }
  266. .icon-xl {
  267. @include icon-image(64rpx);
  268. }
  269. .icon-xxl {
  270. @include icon-image(120rpx);
  271. }
  272. .img-null {
  273. width: 300rpx;
  274. height: 300rpx;
  275. }
  276. /* 隐藏滚动条 */
  277. ::-webkit-scrollbar {
  278. width: 0;
  279. height: 0;
  280. color: transparent;
  281. }
  282. //#ifndef H5
  283. /* 单选 */
  284. radio {
  285. .uni-radio-input {
  286. border-radius: 50%;
  287. width: 34rpx;
  288. height: 34rpx;
  289. }
  290. .uni-radio-input {
  291. border-radius: 50%;
  292. width: 34rpx;
  293. height: 34rpx;
  294. &.uni-radio-input-checked {
  295. border: 1px solid $-color-primary !important;
  296. background-color: $-color-primary !important;
  297. }
  298. }
  299. }
  300. /* 多选 */
  301. checkbox {
  302. .uni-checkbox-input {
  303. border-radius: 50%;
  304. width: 34rpx;
  305. height: 34rpx;
  306. &.uni-checkbox-input-checked {
  307. border: 1px solid $-color-primary !important;
  308. background-color: $-color-primary !important;
  309. color: #fff !important;
  310. &::before {
  311. font-size: 35rpx;
  312. }
  313. }
  314. }
  315. }
  316. //#endif
  317. // #ifdef MP-WEIXIN
  318. /* 单选 */
  319. radio {
  320. .wx-radio-input {
  321. border-radius: 50%;
  322. width: 34rpx;
  323. height: 34rpx;
  324. }
  325. .wx-radio-input {
  326. border-radius: 50%;
  327. width: 34rpx;
  328. height: 34rpx;
  329. &.wx-radio-input-checked {
  330. border: 1px solid $-color-primary !important;
  331. background-color: $-color-primary !important;
  332. }
  333. }
  334. }
  335. /* 多选 */
  336. checkbox {
  337. .wx-checkbox-input {
  338. border-radius: 50%;
  339. width: 34rpx;
  340. height: 34rpx;
  341. &.wx-checkbox-input-checked {
  342. border: 1px solid $-color-primary !important;
  343. background-color: $-color-primary !important;
  344. color: #fff !important;
  345. &::before {
  346. font-size: 35rpx;
  347. }
  348. }
  349. }
  350. }
  351. // #endif