uni.scss 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. /**
  2. * uni-app内置的常用样式变量
  3. */
  4. /* 行为相关颜色 */
  5. $uni-color-primary: #007aff;
  6. $uni-color-success: #4cd964;
  7. $uni-color-warning: #f0ad4e;
  8. $uni-color-error: #dd524d;
  9. /* 文字基本颜色 */
  10. $uni-text-color:#333;//基本色
  11. $uni-text-color-inverse:#fff;//反色
  12. $uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
  13. $uni-text-color-placeholder: #808080;
  14. $uni-text-color-disable:#c0c0c0;
  15. /* 背景颜色 */
  16. $uni-bg-color:#ffffff;
  17. $uni-bg-color-grey:#f8f8f8;
  18. $uni-bg-color-hover:#f1f1f1;//点击状态颜色
  19. $uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
  20. /* 边框颜色 */
  21. $uni-border-color:#e5e5e5;
  22. /* 尺寸变量 */
  23. /* 文字尺寸 */
  24. $uni-font-size-sm:12px;
  25. $uni-font-size-base:14px;
  26. $uni-font-size-lg:16px;
  27. /* 图片尺寸 */
  28. $uni-img-size-sm:20px;
  29. $uni-img-size-base:26px;
  30. $uni-img-size-lg:40px;
  31. /* Border Radius */
  32. $uni-border-radius-sm: 2px;
  33. $uni-border-radius-base: 3px;
  34. $uni-border-radius-lg: 6px;
  35. $uni-border-radius-circle: 50%;
  36. /* 水平间距 */
  37. $uni-spacing-row-sm: 5px;
  38. $uni-spacing-row-base: 10px;
  39. $uni-spacing-row-lg: 15px;
  40. /* 垂直间距 */
  41. $uni-spacing-col-sm: 4px;
  42. $uni-spacing-col-base: 8px;
  43. $uni-spacing-col-lg: 12px;
  44. /* 透明度 */
  45. $uni-opacity-disabled: 0.3; // 组件禁用态的透明度
  46. /* 文章场景相关 */
  47. $uni-color-title: #2C405A; // 文章标题颜色
  48. $uni-font-size-title:20px;
  49. $uni-color-subtitle: #555555; // 二级标题颜色
  50. $uni-font-size-subtitle:26px;
  51. $uni-color-paragraph: #3F536E; // 文章段落颜色
  52. $uni-font-size-paragraph:15px;
  53. /* 颜色变量 */
  54. $uni-color-red: #ff4141;
  55. $uni-color-yellow: #f5b951;
  56. $uni-color-green: #26ae7e;
  57. $uni-color-grey: #f4f4f4;
  58. $uni-color-darkgrey: #828282;
  59. $uni-color-primary: #5677fc;
  60. $uni-color-success: #55be75;
  61. $uni-color-warning: #ff7900;
  62. $uni-color-error: #EB0909;
  63. $uni-color-blue: #416792;
  64. $uni-color-black: #000000;
  65. $uni-color-white: #ffffff;
  66. $uni-color-pink:#f74d54;
  67. $uni-color-link:#586c94;
  68. /* 背景色 */
  69. .uni-bg-red {
  70. background: $uni-color-red !important;
  71. }
  72. .uni-bg-green {
  73. background: $uni-color-green !important;
  74. }
  75. .uni-bg-blue {
  76. background: $uni-color-white !important;
  77. }
  78. .uni-bg-white {
  79. background: $uni-color-white !important;
  80. }
  81. .uni-bg-grey {
  82. background: $uni-color-grey !important;
  83. }
  84. .uni-bg-darkgrey {
  85. background: $uni-color-darkgrey !important;
  86. }
  87. .uni-color-darkgrey {
  88. color: $uni-color-darkgrey;
  89. }
  90. .uni-color-green {
  91. color: $uni-color-green;
  92. }
  93. .uni-color-yellow {
  94. color: $uni-color-yellow;
  95. }
  96. .uni-color-blue {
  97. color: $uni-color-blue;
  98. }
  99. .uni-color-white {
  100. color: $uni-color-white;
  101. }
  102. .color-999{
  103. color: #999;
  104. }
  105. .color-888{
  106. color: #888;
  107. }
  108. .color-777{
  109. color: #777;
  110. }
  111. .color-333{
  112. color: #333;
  113. }
  114. .color-666{
  115. color: #666;
  116. }
  117. .color-000{
  118. color: #000;
  119. }
  120. .color-blue {
  121. color: #58688a;
  122. }
  123. .borb-eee{
  124. position: relative;
  125. &:before{
  126. position: absolute;
  127. bottom: 0;
  128. left: 0;
  129. right: 0;
  130. z-index: 1;
  131. height: 1px;
  132. content: '';
  133. -webkit-transform: scaleY(0.5);
  134. transform: scaleY(0.5);
  135. background-color: #e5e5e5;
  136. }
  137. &:last-child:before {
  138. display: none;
  139. }
  140. }
  141. .bort-eee{
  142. border-top: 1rpx solid #eee;
  143. }
  144. .bor-eee{
  145. border: 1rpx solid #eee;
  146. }
  147. .uni-text-red, .uni-color-red {
  148. color: $uni-color-red !important;
  149. }
  150. /* 文字基本颜色 */
  151. $uni-text-color:#000000;//基本色
  152. $uni-text-color-inverse:#ffffff;//反色
  153. $uni-text-color-grey:#828282;//辅助灰色,如加载更多的提示信息
  154. $uni-text-color-placeholder: #bfbfbf;
  155. $uni-text-color-disable:#c0c0c0;
  156. /* 背景颜色 */
  157. $uni-bg-color:#f4f4f4;
  158. $uni-bg-white:#fff;
  159. $uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
  160. .page-floor{
  161. padding-bottom: constant(safe-area-inset-bottom);
  162. padding-bottom: env(safe-area-inset-bottom);
  163. }
  164. .page-menu {
  165. position: fixed;
  166. z-index: 10;
  167. left: 0;
  168. top: 0;
  169. right: 0;
  170. }
  171. .page-btn-fixed {
  172. height: 140rpx;
  173. padding-bottom: constant(safe-area-inset-bottom);
  174. padding-bottom: env(safe-area-inset-bottom);
  175. .btn-fixed {
  176. position: fixed;
  177. z-index: 10;
  178. left: 0;
  179. right: 0;
  180. bottom: 0;
  181. height: 140rpx;
  182. padding: 0 30rpx;
  183. background: linear-gradient(to bottom, rgba(255,255,255,0), #ffffff 50%);
  184. // background-color: #ffffff;
  185. border-bottom: constant(safe-area-inset-bottom) solid #ffffff;
  186. border-bottom: env(safe-area-inset-bottom) solid #ffffff;
  187. display: flex;
  188. align-items: center;
  189. .btn-other {
  190. flex: 1;
  191. height: 88rpx;
  192. background-color: #ffffff;
  193. border: 1px solid #888888;
  194. color: #999999;
  195. border-radius: 80rpx;
  196. }
  197. .btn-save{
  198. flex: 1;
  199. height: 88rpx;
  200. background-color: #5677fc;
  201. border: 1px solid #5677fc;
  202. color: #fff;
  203. border-radius: 80rpx;
  204. }
  205. .btn {
  206. flex: 1;
  207. height: 88rpx;
  208. background-color: #bc271b;
  209. border: 1px solid #bc271b;
  210. color: #ffffff;
  211. border-radius: 80rpx;
  212. }
  213. .btn-box{
  214. border-radius: 80rpx;
  215. box-shadow: 0 0 12rpx 12rpx rgba(0,0,0,0.04);
  216. overflow: hidden;
  217. display: flex;
  218. align-items: center;
  219. .btn-other{
  220. background-color: #f4f4f4;
  221. }
  222. .btn-save{
  223. background-color: #5677fc;
  224. }
  225. .btn-other,.btn,.btn-save{
  226. border-radius: 0;
  227. border: none;
  228. }
  229. }
  230. }
  231. }
  232. $i: 60;
  233. @mixin font-x {
  234. @while ($i >= 0) {
  235. .font-#{$i} { font-size: #{$i}rpx !important; }
  236. .padding-#{$i} { padding: #{$i}rpx;}
  237. .margin-#{$i} { margin: #{$i}rpx;}
  238. .mt-#{$i} { margin-top: #{$i}rpx !important; }
  239. .mr-#{$i} { margin-right: #{$i}rpx !important; }
  240. .mb-#{$i} { margin-bottom: #{$i}rpx !important; }
  241. .ml-#{$i} { margin-left: #{$i}rpx !important; }
  242. .pt-#{$i} { padding-top: #{$i}rpx !important; }
  243. .pr-#{$i} { padding-right: #{$i}rpx !important; }
  244. .pb-#{$i} { padding-bottom: #{$i}rpx !important; }
  245. .pl-#{$i} { padding-left: #{$i}rpx !important; }
  246. .br-#{$i} { border-radius: #{$i}rpx !important; overflow: hidden; }
  247. $i: $i - 2;
  248. }
  249. }
  250. @include font-x;
  251. $i: 12;
  252. @mixin col-x {
  253. @while ($i >= 0) {
  254. .col-#{$i} { width: #{$i*100/12}% !important; }
  255. .flex-#{$i} { flex: #{$i} !important; }
  256. $i: $i - 1;
  257. }
  258. }
  259. @include col-x;
  260. .over-h {
  261. overflow: hidden;
  262. }
  263. .df {
  264. display: -webkit-flex !important;
  265. display: flex !important;
  266. }
  267. .df-column{
  268. flex-direction: column !important;
  269. }
  270. .ai-center {
  271. /* 垂直居中 */
  272. align-items: center !important;
  273. }
  274. .ai-flex-start {
  275. /* 起点对齐 */
  276. align-items: flex-start !important;
  277. }
  278. .ai-flex-end {
  279. /* 底部对齐 */
  280. align-items: flex-end !important;
  281. }
  282. .ai-baseline {
  283. /* 中间文字对齐 */
  284. align-items: baseline !important;
  285. }
  286. .jc-center {
  287. justify-content: center !important;
  288. }
  289. .jc-flex-start {
  290. justify-content: flex-start !important;
  291. }
  292. .jc-flex-end {
  293. justify-content: flex-end !important;
  294. }
  295. .jc-space-between {
  296. justify-content: space-between !important;
  297. }
  298. .jc-space-around {
  299. justify-content: space-around !important;
  300. }
  301. .fw-nowrap {
  302. flex-wrap: nowrap !important;
  303. }
  304. .fw-wrap {
  305. flex-wrap: wrap !important;
  306. }
  307. .fw-wr {
  308. flex-wrap: wrap-reverse !important;
  309. }
  310. .position-abs {
  311. position: absolute !important;
  312. }
  313. .position-rel {
  314. position: relative !important;
  315. }
  316. .position-fix {
  317. position: fixed;
  318. }
  319. .omit-1 {
  320. overflow: hidden;
  321. text-overflow: ellipsis;
  322. white-space: nowrap;
  323. }
  324. .omit-2 {
  325. overflow: hidden;
  326. word-break: break-all;
  327. text-overflow: ellipsis;
  328. display: -webkit-box;
  329. -webkit-box-orient: vertical;
  330. -webkit-line-clamp: 2;
  331. max-height: 100rpx;
  332. }
  333. .omit-3 {
  334. overflow: hidden;
  335. word-break: break-all;
  336. text-overflow: ellipsis;
  337. display: -webkit-box;
  338. -webkit-box-orient: vertical;
  339. -webkit-line-clamp: 3;
  340. max-height: 200rpx;
  341. }
  342. .omit-5 {
  343. overflow: hidden;
  344. word-break: break-all;
  345. text-overflow: ellipsis;
  346. display: -webkit-box;
  347. -webkit-box-orient: vertical;
  348. -webkit-line-clamp: 5;
  349. max-height: 300rpx;
  350. }
  351. //gui样式
  352. .gui-select {
  353. font-size: 24rpx;
  354. color: #26ae7e;
  355. background-color: #ffffff;
  356. height: 52rpx;
  357. border: 1px solid #26ae7e;
  358. padding: 0 28rpx;
  359. display: flex;
  360. align-items: center;
  361. justify-content: center;
  362. border-radius: 50rpx;
  363. overflow: hidden;
  364. .text {
  365. flex: 1;
  366. }
  367. &::after{
  368. content: " ";
  369. height: 10px;
  370. width: 10px;
  371. border-width: 0px 2px 2px 0;
  372. border-color: #c0c0c0;
  373. border-style: solid;
  374. -webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
  375. transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
  376. margin-left: 20rpx;
  377. }
  378. }
  379. .uni-btn {
  380. background-color: #bc271b !important;
  381. border-color: #bc271b !important;
  382. margin: 0;
  383. // border: 1rpx solid #26ae7e !important;
  384. border-radius: 80rpx;
  385. color: #ffffff;
  386. font-size: 32rpx;
  387. &::after{
  388. // display: none !important;
  389. // border-radius: 80rpx !important;
  390. }
  391. &:active {
  392. background-color: #bc271b !important;
  393. border-color: #bc271b !important;
  394. color: #eee;
  395. }
  396. &.disabled {
  397. background-color: #e1847c !important;
  398. border-color: #e1847c !important;
  399. color: #dddddd;
  400. }
  401. }
  402. .uni-btn-line {
  403. background-color: #ffffff !important;
  404. border-color: #bc271b !important;
  405. margin: 0;
  406. // border: 1rpx solid #26ae7e !important;
  407. border-radius: 80rpx;
  408. color: #bc271b;
  409. font-size: 32rpx;
  410. &::after{
  411. // display: none !important;
  412. // border-radius: 80rpx !important;
  413. }
  414. &:active {
  415. background-color: #ffffff !important;
  416. border-color: #bc271b !important;
  417. color: #bc271b;
  418. }
  419. &.disabled {
  420. background-color: #ffffff !important;
  421. border-color: #e1847c !important;
  422. color: #dddddd;
  423. }
  424. }
  425. .uni-input {
  426. text-align: right;
  427. font-size: 26rpx;
  428. height: 88rpx;
  429. min-height: 88rpx;
  430. line-height: 88rpx;
  431. }
  432. .font-bold{
  433. font-weight: bold;
  434. }
  435. .text-center{
  436. text-align: center;
  437. }
  438. .text-right{
  439. text-align: right;
  440. }
  441. .text-left{
  442. text-align: left;
  443. }
  444. .text-justify{
  445. text-align: justify;
  446. }