main.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. $direction: top, right, bottom, left;
  2. body {
  3. // 全局灰白效果
  4. /* filter: grayscale(100%);
  5. -webkit-filter: grayscale(100%); */
  6. background-color: $tn-bg-color;
  7. /* background-color: #ffffff; */
  8. font-size: 28rpx;
  9. color: $tn-font-color;
  10. font-family: Helvetica Neue, Helvetica, sans-serif;
  11. // 修复点击view标签的时候会有蓝色遮罩
  12. -webkit-tap-highlight-color: rgba(0,0,0,0);
  13. }
  14. view,
  15. scroll-view,
  16. swiper,
  17. button,
  18. input,
  19. textarea,
  20. label,
  21. navigator,
  22. image {
  23. box-sizing: border-box;
  24. }
  25. button::after {
  26. border: none;
  27. }
  28. .tn-round {
  29. border-radius: 5000rpx !important;
  30. }
  31. .tn-radius {
  32. border-radius: 6rpx;
  33. }
  34. /* 基本样式 start */
  35. .tn-width-full {
  36. width: 100%;
  37. }
  38. .tn-height-full {
  39. height: 100%;
  40. }
  41. /* 基本样式 end */
  42. /* 边框 start */
  43. .tn-border-solid,
  44. .tn-border-solid-top,
  45. .tn-border-solid-right,
  46. .tn-border-solid-bottom,
  47. .tn-border-solid-left,
  48. .tn-border-solids,
  49. .tn-border-solids-top,
  50. .tn-border-solids-right,
  51. .tn-border-solids-bottom,
  52. .tn-border-solids-left,
  53. .tn-border-dashed,
  54. .tn-border-dashed-top,
  55. .tn-border-dashed-right,
  56. .tn-border-dashed-bottom,
  57. .tn-border-dashed-left {
  58. border-radius: inherit;
  59. box-sizing: border-box;
  60. }
  61. @for $i from 0 to length($direction) + 1 {
  62. @if $i == 0 {
  63. .tn-border-solid {
  64. border-width: 1rpx !important;
  65. border-style: solid;
  66. border-color: $tn-border-solid-color;
  67. &.tn-bold-border {
  68. border-width: 6rpx !important;
  69. }
  70. }
  71. .tn-border-solids {
  72. border-width: 1rpx !important;
  73. border-style: solid;
  74. border-color: $tn-border-solids-color;
  75. &.tn-bold-border {
  76. border-width: 6rpx !important;
  77. }
  78. }
  79. .tn-border-dashed {
  80. border-width: 1rpx !important;
  81. border-style: dashed;
  82. border-color: $tn-border-dashed-color;
  83. &.tn-bold-border {
  84. border-width: 6rpx !important;
  85. }
  86. }
  87. } @else {
  88. .tn-border-solid-#{nth($direction, $i)} {
  89. border: 0rpx;
  90. border-#{nth($direction, $i)}-width: 1rpx !important;
  91. border-style: solid;
  92. border-color: $tn-border-solid-color;
  93. &.tn-bold-border {
  94. border-#{nth($direction, $i)}-width: 6rpx !important;
  95. }
  96. }
  97. .tn-border-solids-#{nth($direction, $i)} {
  98. border: 0rpx;
  99. border-#{nth($direction, $i)}-width: 1rpx !important;
  100. border-style: solid;
  101. border-color: $tn-border-solids-color;
  102. &.tn-bold-border {
  103. border-#{nth($direction, $i)}-width: 6rpx !important;
  104. }
  105. }
  106. .tn-border-dashed-#{nth($direction, $i)} {
  107. border: 0rpx;
  108. border-#{nth($direction, $i)}-width: 1rpx !important;
  109. border-style: dashed;
  110. border-color: $tn-border-dashed-color;
  111. &.tn-bold-border {
  112. border-#{nth($direction, $i)}-width: 6rpx !important;
  113. }
  114. }
  115. }
  116. }
  117. .tn-none-border.tn-border-solid,
  118. .tn-none-border.tn-border-solid-top,
  119. .tn-none-border.tn-border-solid-right,
  120. .tn-none-border.tn-border-solid-bottom,
  121. .tn-none-border.tn-border-solid-left,
  122. .tn-none-border.tn-border-solids,
  123. .tn-none-border.tn-border-solids-top,
  124. .tn-none-border.tn-border-solids-right,
  125. .tn-none-border.tn-border-solids-bottom,
  126. .tn-none-border.tn-border-solids-left,
  127. .tn-none-border.tn-border-dashed,
  128. .tn-none-border.tn-border-dashed-top,
  129. .tn-none-border.tn-border-dashed-right,
  130. .tn-none-border.tn-border-dashed-bottom,
  131. .tn-none-border.tn-border-dashed-left {
  132. border: 0 !important;
  133. }
  134. .tn-none-border-top.tn-border-solid,
  135. .tn-none-border-top.tn-border-solid-top,
  136. .tn-none-border-top.tn-border-solid-right,
  137. .tn-none-border-top.tn-border-solid-bottom,
  138. .tn-none-border-top.tn-border-solid-left,
  139. .tn-none-border-top.tn-border-solids,
  140. .tn-none-border-top.tn-border-solids-top,
  141. .tn-none-border-top.tn-border-solids-right,
  142. .tn-none-border-top.tn-border-solids-bottom,
  143. .tn-none-border-top.tn-border-solids-left,
  144. .tn-none-border-top.tn-border-dashed,
  145. .tn-none-border-top.tn-border-dashed-top,
  146. .tn-none-border-top.tn-border-dashed-right,
  147. .tn-none-border-top.tn-border-dashed-bottom,
  148. .tn-none-border-top.tn-border-dashed-left {
  149. /* height: 0 !important; */
  150. border-top: 0 !important;
  151. }
  152. .tn-none-border-right.tn-border-solid,
  153. .tn-none-border-right.tn-border-solid-top,
  154. .tn-none-border-right.tn-border-solid-right,
  155. .tn-none-border-right.tn-border-solid-bottom,
  156. .tn-none-border-right.tn-border-solid-left,
  157. .tn-none-border-right.tn-border-solids,
  158. .tn-none-border-right.tn-border-solids-top,
  159. .tn-none-border-right.tn-border-solids-right,
  160. .tn-none-border-right.tn-border-solids-bottom,
  161. .tn-none-border-right.tn-border-solids-left,
  162. .tn-none-border-right.tn-border-dashed,
  163. .tn-none-border-right.tn-border-dashed-top,
  164. .tn-none-border-right.tn-border-dashed-right,
  165. .tn-none-border-right.tn-border-dashed-bottom,
  166. .tn-none-border-right.tn-border-dashed-left {
  167. /* width: 0 !important; */
  168. border-right: 0 !important;
  169. }
  170. .tn-none-border-bottom.tn-border-solid,
  171. .tn-none-border-bottom.tn-border-solid-top,
  172. .tn-none-border-bottom.tn-border-solid-right,
  173. .tn-none-border-bottom.tn-border-solid-bottom,
  174. .tn-none-border-bottom.tn-border-solid-left,
  175. .tn-none-border-bottom.tn-border-solids,
  176. .tn-none-border-bottom.tn-border-solids-top,
  177. .tn-none-border-bottom.tn-border-solids-right,
  178. .tn-none-border-bottom.tn-border-solids-bottom,
  179. .tn-none-border-bottom.tn-border-solids-left,
  180. .tn-none-border-bottom.tn-border-dashed,
  181. .tn-none-border-bottom.tn-border-dashed-top,
  182. .tn-none-border-bottom.tn-border-dashed-right,
  183. .tn-none-border-bottom.tn-border-dashed-bottom,
  184. .tn-none-border-bottom.tn-border-dashed-left {
  185. /* height: 0 !important; */
  186. border-bottom: 0 !important;
  187. }
  188. .tn-none-border-left.tn-border-solid,
  189. .tn-none-border-left.tn-border-solid-top,
  190. .tn-none-border-left.tn-border-solid-right,
  191. .tn-none-border-left.tn-border-solid-bottom,
  192. .tn-none-border-left.tn-border-solid-left,
  193. .tn-none-border-left.tn-border-solids,
  194. .tn-none-border-left.tn-border-solids-top,
  195. .tn-none-border-left.tn-border-solids-right,
  196. .tn-none-border-left.tn-border-solids-bottom,
  197. .tn-none-border-left.tn-border-solids-left,
  198. .tn-none-border-left.tn-border-dashed,
  199. .tn-none-border-left.tn-border-dashed-top,
  200. .tn-none-border-left.tn-border-dashed-right,
  201. .tn-none-border-left.tn-border-dashed-bottom,
  202. .tn-none-border-left.tn-border-dashed-left {
  203. /* width: 0 !important; */
  204. border-left: 0 !important;
  205. }
  206. /* 边框 end */
  207. /* 阴影 start */
  208. .tn-shadow {
  209. box-shadow: 6rpx 6rpx 8rpx $tn-shadow-color;
  210. }
  211. .tn-shadow-warp {
  212. position: relative;
  213. box-shadow: 0 0 10rpx $tn-shadow-color;
  214. }
  215. .tn-shadow-warp::before,
  216. .tn-shadow-warp::after {
  217. content: " ";
  218. position: absolute;
  219. top: 20rpx;
  220. bottom: 30rpx;
  221. left: 20rpx;
  222. width: 50%;
  223. box-shadow: 0 30rpx 20rpx $tn-box-shadow-color;
  224. transform: rotate(-3deg);
  225. z-index: -1;
  226. }
  227. .tn-shadow-warp::after {
  228. right: 20rpx;
  229. left: auto;
  230. transform: rotate(3deg);
  231. }
  232. .tn-shadow-blur {
  233. position: relative;
  234. }
  235. .tn-shadow-blur::before {
  236. content: " ";
  237. display: block;
  238. background: inherit;
  239. filter: blur(10rpx);
  240. position: absolute;
  241. width: 100%;
  242. height: 100%;
  243. top: 10rpx;
  244. left: 10rpx;
  245. z-index: -1;
  246. opacity: 0.4;
  247. transform-origin: 0 0;
  248. border-radius: inherit;
  249. transform: scale(1, 1);
  250. }
  251. /* 阴影 end */
  252. /* flex start */
  253. .tn-flex {
  254. display: -webkit-flex;
  255. display: flex;
  256. }
  257. /* flex伸缩基准值 */
  258. .tn-flex-basic-xs {
  259. flex-basis: 20%;
  260. }
  261. .tn-flex-basic-sm {
  262. flex-basis: 40%;
  263. }
  264. .tn-flex-basic-md {
  265. flex-basis: 50%;
  266. }
  267. .tn-flex-basic-lg {
  268. flex-basis: 60%;
  269. }
  270. .tn-flex-basic-xl {
  271. flex-basis: 80%;
  272. }
  273. .tn-flex-basic-full {
  274. flex-basis: 100%;
  275. }
  276. /* flex布局的方向 */
  277. .tn-flex-direction-column {
  278. flex-direction: column;
  279. }
  280. .tn-flex-direction-row {
  281. flex-direction: row;
  282. }
  283. .tn-flex-direction-column-reverse {
  284. flex-direction: column-reverse;
  285. }
  286. .tn-flex-direction-row-reverse {
  287. flex-direction: row-reverse;
  288. }
  289. /* flex容器设置换行 */
  290. .tn-flex-wrap {
  291. flex-wrap: wrap;
  292. }
  293. .tn-flex-nowrap {
  294. flex-wrap: nowrap;
  295. }
  296. /* flex容器自身垂直方向对齐方式 */
  297. .tn-flex-center {
  298. align-self: center;
  299. }
  300. .tn-flex-top {
  301. align-self: flex-start;
  302. }
  303. .tn-flex-end {
  304. align-self: flex-end;
  305. }
  306. .tn-flex-stretch {
  307. align-self: stretch;
  308. }
  309. /* flex子元素垂直方向对齐方式 */
  310. .tn-flex-col-center {
  311. align-items: center;
  312. }
  313. .tn-flex-col-top {
  314. align-items: flex-start;
  315. }
  316. .tn-flex-col-bottom {
  317. align-items: flex-end;
  318. }
  319. /* flex子元素水平方向对齐方式 */
  320. .tn-flex-row-center {
  321. justify-content: center;
  322. }
  323. .tn-flex-row-left {
  324. justify-content: flex-start;
  325. }
  326. .tn-flex-row-right {
  327. justify-content: flex-end;
  328. }
  329. .tn-flex-row-between {
  330. justify-content: space-between;
  331. }
  332. .tn-flex-row-around {
  333. justify-content: space-around;
  334. }
  335. /* flex子元素空间分配 */
  336. @for $i from 0 to 12 {
  337. .tn-flex-#{$i} {
  338. flex: $i;
  339. }
  340. }
  341. .tn-col-12 {
  342. width: 100%;
  343. }
  344. .tn-col-11 {
  345. width: 91.66666667%;
  346. }
  347. .tn-col-10 {
  348. width: 83.33333333%;
  349. }
  350. .tn-col-9 {
  351. width: 75%;
  352. }
  353. .tn-col-8 {
  354. width: 66.66666667%;
  355. }
  356. .tn-col-7 {
  357. width: 58.33333333%;
  358. }
  359. .tn-col-6 {
  360. width: 50%;
  361. }
  362. .tn-col-5 {
  363. width: 41.66666667%;
  364. }
  365. .tn-col-4 {
  366. width: 33.33333333%;
  367. }
  368. .tn-col-3 {
  369. width: 25%;
  370. }
  371. .tn-col-2 {
  372. width: 16.66666667%;
  373. }
  374. .tn-col-1 {
  375. width: 8.33333333%;
  376. }
  377. /* flex end */
  378. /* 内边距 start */
  379. @for $i from 0 to length($direction) + 1 {
  380. @if $i == 0 {
  381. .tn-no-margin {
  382. margin: 0;
  383. }
  384. .tn-margin-xs {
  385. margin: 10rpx;
  386. }
  387. .tn-margin-sm {
  388. margin: 20rpx;
  389. }
  390. .tn-margin {
  391. margin: 30rpx;
  392. }
  393. .tn-margin-lg {
  394. margin: 40rpx;
  395. }
  396. .tn-margin-xl {
  397. margin: 50rpx;
  398. }
  399. } @else {
  400. .tn-no-margin-#{nth($direction, $i)} {
  401. margin-#{nth($direction, $i)}: 0;
  402. }
  403. .tn-margin-#{nth($direction, $i)}-xs {
  404. margin-#{nth($direction, $i)}: 10rpx;
  405. }
  406. .tn-margin-#{nth($direction, $i)}-sm {
  407. margin-#{nth($direction, $i)}: 20rpx;
  408. }
  409. .tn-margin-#{nth($direction, $i)} {
  410. margin-#{nth($direction, $i)}: 30rpx;
  411. }
  412. .tn-margin-#{nth($direction, $i)}-lg {
  413. margin-#{nth($direction, $i)}: 40rpx;
  414. }
  415. .tn-margin-#{nth($direction, $i)}-xl {
  416. margin-#{nth($direction, $i)}: 50rpx;
  417. }
  418. }
  419. }
  420. /* 内边距 end */
  421. /* 外边距 start */
  422. @for $i from 0 to length($direction) + 1 {
  423. @if $i == 0 {
  424. .tn-no-padding {
  425. padding: 0;
  426. }
  427. .tn-padding-xs {
  428. padding: 10rpx;
  429. }
  430. .tn-padding-sm {
  431. padding: 20rpx;
  432. }
  433. .tn-padding {
  434. padding: 30rpx;
  435. }
  436. .tn-padding-lg {
  437. padding: 40rpx;
  438. }
  439. .tn-padding-xl {
  440. padding: 50rpx;
  441. }
  442. } @else {
  443. .tn-no-padding-#{nth($direction, $i)} {
  444. padding-#{nth($direction, $i)}: 0;
  445. }
  446. .tn-padding-#{nth($direction, $i)}-xs {
  447. padding-#{nth($direction, $i)}: 10rpx;
  448. }
  449. .tn-padding-#{nth($direction, $i)}-sm {
  450. padding-#{nth($direction, $i)}: 20rpx;
  451. }
  452. .tn-padding-#{nth($direction, $i)} {
  453. padding-#{nth($direction, $i)}: 30rpx;
  454. }
  455. .tn-padding-#{nth($direction, $i)}-lg {
  456. padding-#{nth($direction, $i)}: 40rpx;
  457. }
  458. .tn-padding-#{nth($direction, $i)}-xl {
  459. padding-#{nth($direction, $i)}: 50rpx;
  460. }
  461. }
  462. }
  463. /* 外边距 end */
  464. /* float start */
  465. .tn-float-left {
  466. float: left;
  467. }
  468. .tn-float-right {
  469. float: right;
  470. }
  471. .tn-clear-float {
  472. clear: both;
  473. }
  474. .tn-clear-float::after,
  475. .tn-clear-float::before {
  476. content: " ";
  477. display: table;
  478. clear: both;
  479. }
  480. /* float end */
  481. /* 文本 start */
  482. .tn-text-xs {
  483. font-size: 20rpx;
  484. }
  485. .tn-text-sm {
  486. font-size: 24rpx;
  487. }
  488. .tn-text-md {
  489. font-size: 28rpx;
  490. }
  491. .tn-text-lg {
  492. font-size: 32rpx;
  493. }
  494. .tn-text-xl {
  495. font-size: 36rpx;
  496. }
  497. .tn-text-xxl {
  498. font-size: 40rpx;
  499. }
  500. .tn-text-xl-xxl {
  501. font-size: 80rpx;
  502. }
  503. .tn-text-xxl-xxl {
  504. font-size: 120rpx;
  505. }
  506. .tn-text-upper {
  507. text-transform: uppercase;
  508. }
  509. .tn-text-cap {
  510. text-transform: capitalize;
  511. }
  512. .tn-text-lower {
  513. text-transform: lowercase;
  514. }
  515. .tn-text-bold {
  516. font-weight: bold;
  517. }
  518. .tn-text-center {
  519. text-align: center;
  520. }
  521. .tn-text-left {
  522. text-align: left;
  523. }
  524. .tn-text-right {
  525. text-align: right;
  526. }
  527. .tn-text-justify {
  528. text-align: justify;
  529. }
  530. .tn-text-content {
  531. line-height: 1.6;
  532. }
  533. .tn-text-ellipsis {
  534. overflow: hidden;
  535. white-space: nowrap;
  536. text-overflow: ellipsis;
  537. }
  538. .tn-text-ellipsis-2 {
  539. display: -webkit-box;
  540. overflow: hidden;
  541. white-space: normal !important;
  542. text-overflow: ellipsis;
  543. word-wrap: break-word;
  544. -webkit-line-clamp: 2;
  545. -webkit-box-orient: vertical;
  546. }
  547. .tn-text-clip {
  548. -webkit-background-clip: text;
  549. color: transparent !important;
  550. }
  551. .tn-text-break-word {
  552. word-wrap: break-word;
  553. }
  554. /* 文本 end */
  555. /* hover 点击效果 start */
  556. .tn-hover {
  557. opacity: 0.6;
  558. }
  559. /* hover 点击效果 end */
  560. /* 去除原生button样式 start */
  561. .tn-button--clear-style {
  562. background-color: transparent;
  563. padding: 0;
  564. margin: 0;
  565. font-size: inherit;
  566. line-height: inherit;
  567. border-radius: inherit;
  568. color: inherit;
  569. }
  570. /* 去除原生button样式 end */
  571. /* 头像组 start */
  572. // .tn-avatar-group {
  573. // direction: rtl;
  574. // unicode-bidi: bidi-override;
  575. // padding: 0 10rpx 0 40rpx;
  576. // display: inline-block;
  577. // .tn-avatar {
  578. // margin-left: -30rpx !important;
  579. // border: 4rpx solid $tn-border-solid-color;
  580. // vertical-align: middle;
  581. // &--sm {
  582. // margin-left: -20rpx !important;
  583. // border: 1rpx solid $tn-border-solid-color;
  584. // }
  585. // }
  586. // }
  587. /* 头像组 end */
  588. /* 提升H5端uni.toast()的层级,避免被tn-modal等遮盖 start */
  589. /* #ifdef H5 */
  590. uni-toast {
  591. z-index: 10090;
  592. }
  593. uni-toast .uni-toast {
  594. z-index: 10090;
  595. }
  596. /* #endif */
  597. /* 提升H5端uni.toast()的层级,避免被tn-modal等遮盖 end */
  598. /* iPhoneX底部安全区定义 start */
  599. .tn-safe-area-inset-bottom {
  600. padding-bottom: 0;
  601. padding-bottom: constant(safe-area-inset-bottom);
  602. padding-bottom: env(safe-area-inset-bottom);
  603. }
  604. /* iPhoneX底部安全区定义 end */