main.scss 13 KB

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