thinco.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. // thinco样式库
  2. /* ============ 初始化 ============*/
  3. /* ============ 样式 ============*/
  4. // 页面最外层
  5. .wrap-page {
  6. display: flex;
  7. flex: 1;
  8. flex-direction: column;
  9. padding: 20px 20px;
  10. background-color: #f4f6f6;
  11. }
  12. // 内容盒子
  13. .wrap-box {
  14. background-color: #ffffff;
  15. padding: 20px;
  16. border-radius: 10px;
  17. }
  18. // 标签tag
  19. .wrap-tag-blue {
  20. display: flex;
  21. flex-direction: row;
  22. flex-wrap: wrap;
  23. .tag {
  24. color: #616df2;
  25. border: 2px solid #616df2;
  26. padding: 5px 10px;
  27. border-radius: 2px;
  28. margin: auto 10px;
  29. flex-shrink: 0;
  30. &.active {
  31. background-color: #616df2;
  32. color: #fff;
  33. }
  34. }
  35. }
  36. // 标签
  37. .wrap-tag-gray {
  38. display: flex;
  39. flex-direction: row;
  40. flex-wrap: wrap;
  41. .tag {
  42. color: #939393;
  43. border: 2px solid #f4f4f4;
  44. background-color: #f4f4f4;
  45. padding: 5px 10px;
  46. border-radius: 2px;
  47. margin: auto 10px;
  48. flex-shrink: 0;
  49. &.active {
  50. color: #898ce7;
  51. background-color: #f3f1fd;
  52. }
  53. }
  54. }
  55. /* ============ 颜色 ============*/
  56. // 常用颜色
  57. $border-color: #d1d5db; // 主边框颜色(灰色)
  58. $icon-color: #616df2; // 主图标颜色(蓝色)
  59. .icon-color {
  60. color: $icon-color;
  61. }
  62. .border-color {
  63. color: $border-color;
  64. }
  65. // 其他颜色
  66. $color: (
  67. // 灰色
  68. gray-50: #f9fafb,
  69. gray-100: #f3f4f6,
  70. gray-200: #e5e7eb,
  71. gray-300: #d1d5db,
  72. gray-400: #9ca3af,
  73. gray-500: #6b7280,
  74. gray-600: #4b5563,
  75. gray-700: #374151,
  76. gray-800: #1f2937,
  77. gray-900: #111827,
  78. // 红色
  79. red-50: #fef2f2,
  80. red-100: #fee2e2,
  81. red-200: #fecaca,
  82. red-300: #fca5a5,
  83. red-400: #f87171,
  84. red-500: #ef4444,
  85. red-600: #dc2626,
  86. red-700: #b91c1c,
  87. red-800: #991b1b,
  88. red-900: #7f1d1d,
  89. // 黄色
  90. yellow-50: #fffbeb,
  91. yellow-100: #fef3c7,
  92. yellow-200: #fde68a,
  93. yellow-300: #fcd34d,
  94. yellow-400: #fbbf24,
  95. yellow-500: #f59e0b,
  96. yellow-600: #d97706,
  97. yellow-700: #b45309,
  98. yellow-800: #92400e,
  99. yellow-900: #78350f,
  100. // 绿色
  101. green-50: #ecfdf5,
  102. green-100: #d1fae5,
  103. green-200: #a7f3d0,
  104. green-300: #6ee7b7,
  105. green-400: #34d399,
  106. green-500: #10b981,
  107. green-600: #059669,
  108. green-700: #047857,
  109. green-800: #065f46,
  110. green-900: #064e3b,
  111. // 蓝色
  112. blue-50: #eff6ff,
  113. blue-100: #dbeafe,
  114. blue-200: #bfdbfe,
  115. blue-300: #93c5fd,
  116. blue-400: #60a5fa,
  117. blue-500: #3b82f6,
  118. blue-600: #2563eb,
  119. blue-700: #1d4ed8,
  120. blue-800: #1e40af,
  121. blue-900: #1e3a8a,
  122. // 紫色
  123. purple-50: #f5f3ff,
  124. purple-100: #ede9fe,
  125. purple-200: #ddd6fe,
  126. purple-300: #c4b5fd,
  127. purple-400: #a78bfa,
  128. purple-500: #8b5cf6,
  129. purple-600: #7c3aed,
  130. purple-700: #6d28d9,
  131. purple-800: #5b21b6,
  132. purple-900: #4c1d95
  133. );
  134. // 文本、边框、背景
  135. @each $key, $val in $color {
  136. //文本颜色
  137. .text-#{$key} {
  138. color: #{$val} !important;
  139. }
  140. //边框颜色
  141. .border-#{$key} {
  142. border-color: #{$val} !important;
  143. }
  144. //背景颜色
  145. .bg-#{$key} {
  146. background-color: #{$val} !important;
  147. }
  148. }
  149. // 文本/图标/背景
  150. .text-white {
  151. color: #fff;
  152. }
  153. .text-black {
  154. color: #000;
  155. }
  156. .text-blue {
  157. color: #616df2;
  158. }
  159. .text-gray {
  160. color: #9ca3af;
  161. }
  162. .text-yellow {
  163. color: #faad14;
  164. }
  165. .icon-blue {
  166. color: #616df2;
  167. }
  168. .bg-white {
  169. background-color: #fff;
  170. }
  171. .bg-gray {
  172. background-color: #f2f2f2;
  173. }
  174. /* ============ 布局 ============*/
  175. // box
  176. .box-border {
  177. box-sizing: border-box;
  178. }
  179. .box-content {
  180. box-sizing: content-box;
  181. }
  182. // 显示
  183. .block {
  184. display: block !important;
  185. }
  186. .inline-block {
  187. display: inline-block !important;
  188. }
  189. .inline {
  190. display: inline;
  191. }
  192. .flex {
  193. display: flex !important;
  194. }
  195. .hidden {
  196. display: none !important;
  197. }
  198. // 溢出
  199. .overflow-hidden {
  200. overflow: hidden;
  201. }
  202. .overflow-scroll {
  203. overflow: scroll;
  204. }
  205. .overflow-x-hidden {
  206. overflow-x: hidden;
  207. }
  208. .overflow-y-hidden {
  209. overflow-y: hidden;
  210. }
  211. .overflow-x-scroll {
  212. overflow-x: scroll;
  213. }
  214. .overflow-y-scroll {
  215. overflow-y: scroll;
  216. }
  217. // 定位
  218. .static {
  219. position: static;
  220. }
  221. .relative {
  222. position: relative;
  223. }
  224. .absolute {
  225. position: absolute;
  226. }
  227. .fixed {
  228. position: fixed;
  229. }
  230. .sticky {
  231. position: static;
  232. }
  233. .left-0 {
  234. left: 0;
  235. }
  236. .top-0 {
  237. top: 0;
  238. }
  239. .bottom-0 {
  240. bottom: 0;
  241. }
  242. .right-0 {
  243. right: 0;
  244. }
  245. // 可见性
  246. .visible {
  247. visibility: visible;
  248. }
  249. .invisible {
  250. visibility: hidden;
  251. }
  252. // 优先级
  253. .z-0 {
  254. z-index: 0;
  255. }
  256. .z-10 {
  257. z-index: 10;
  258. }
  259. .z-20 {
  260. z-index: 20;
  261. }
  262. .z-30 {
  263. z-index: 30;
  264. }
  265. .z-40 {
  266. z-index: 40;
  267. }
  268. .z-50 {
  269. z-index: 50;
  270. }
  271. .z-auto {
  272. z-index: auto;
  273. }
  274. // FLEXBOX 布局
  275. // 方向
  276. .flex-row {
  277. flex-direction: row !important;
  278. }
  279. .flex-row-reverse {
  280. flex-direction: row-reverse !important;
  281. }
  282. .flex-col {
  283. flex-direction: column !important;
  284. }
  285. .flex-col-reverse {
  286. flex-direction: column-reverse !important;
  287. }
  288. // 换行
  289. .flex-wrap {
  290. flex-wrap: wrap !important;
  291. }
  292. .flex-wrap-reverse {
  293. flex-wrap: wrap-reverse !important;
  294. }
  295. .flex-nowrap {
  296. flex-wrap: nowrap !important;
  297. }
  298. // 控制 flex 项目放大和缩小
  299. .flex-1 {
  300. flex: 1 1 0% !important;
  301. }
  302. // 控制 flex 项目放大的功能类
  303. .flex-grow-0 {
  304. flex-grow: 0 !important;
  305. }
  306. .flex-grow {
  307. flex-grow: 1 !important;
  308. }
  309. // 控制 flex 项目缩小的功能类
  310. .flex-shrink-0 {
  311. flex-shrink: 0 !important;
  312. }
  313. .flex-shrink {
  314. flex-shrink: 1 !important;
  315. }
  316. // justify-content用于控制 flex 和 grid 项目如何沿着容器的主轴定位的功能类
  317. .justify-start {
  318. justify-content: flex-start !important;
  319. }
  320. .justify-end {
  321. justify-content: flex-end !important;
  322. }
  323. .justify-center {
  324. justify-content: center !important;
  325. }
  326. .justify-between {
  327. justify-content: space-between !important;
  328. }
  329. .justify-around {
  330. justify-content: space-around !important;
  331. }
  332. .justify-evenly {
  333. justify-content: space-evenly !important;
  334. }
  335. // align-items用于控制 Flex 和网格项如何沿着容器的横轴定位的功能类
  336. .items-start {
  337. align-items: flex-start !important;
  338. }
  339. .items-end {
  340. align-items: flex-end !important;
  341. }
  342. .items-center {
  343. align-items: center !important;
  344. }
  345. .items-baseline {
  346. align-items: baseline !important;
  347. }
  348. .items-stretch {
  349. align-items: stretch !important;
  350. }
  351. /* ============ 间距 ============*/
  352. // 上下左右的内外边距:0 - 80(递增数:2,含尾数为5的数)
  353. @for $i from 0 through 80 {
  354. // 只要双数和能被5除尽的数
  355. @if $i % 2 == 0 or $i % 5 == 0 {
  356. // 定义外边距,结果如:m-30
  357. .m-#{$i} {
  358. margin: $i + px !important;
  359. }
  360. // 定义内边距,结果如:p-30
  361. .p-#{$i} {
  362. padding: $i + px !important;
  363. }
  364. @each $short, $long in l left, t top, r right, b bottom {
  365. // 定义外边距,结果如: ml-30
  366. .m#{$short}-#{$i} {
  367. margin-#{$long}: $i + px !important;
  368. }
  369. // 定义内边距
  370. .p#{$short}-#{$i} {
  371. padding-#{$long}: $i + px !important;
  372. }
  373. }
  374. }
  375. }
  376. // 水平和垂直的内外边距:0 - 80(递增数:5)
  377. @for $i from 0 through 16 {
  378. $var: $i * 5;
  379. .mx-#{$var} {
  380. margin-left: $var + px !important;
  381. margin-right: $var + px !important;
  382. }
  383. .my-#{$var} {
  384. margin-top: $var + px !important;
  385. margin-bottom: $var + px !important;
  386. }
  387. .px-#{$var} {
  388. padding-left: $var + px !important;
  389. padding-right: $var + px !important;
  390. }
  391. .py-#{$var} {
  392. padding-top: $var + px !important;
  393. padding-bottom: $var + px !important;
  394. }
  395. }
  396. // 自动填充的内外边距
  397. @each $short, $long in l left, t top, r right, b bottom {
  398. // 定义外边距
  399. .m#{$short}-auto {
  400. margin-#{$long}: auto !important;
  401. }
  402. // 定义内边距
  403. .p#{$short}-auto {
  404. padding-#{$long}: auto !important;
  405. }
  406. }
  407. /* ============ 尺寸 ============*/
  408. // 高度
  409. .h-1-2 {
  410. height: 50%;
  411. }
  412. .h-1-3 {
  413. height: 33.333333%;
  414. }
  415. .h-2-3 {
  416. height: 66.666667%;
  417. }
  418. .h-1-4 {
  419. height: 25%;
  420. }
  421. .h-2-4 {
  422. height: 50%;
  423. }
  424. .h-3-4 {
  425. height: 75%;
  426. }
  427. .h-1-5 {
  428. height: 20%;
  429. }
  430. .h-2-5 {
  431. height: 40%;
  432. }
  433. .h-3-5 {
  434. height: 60%;
  435. }
  436. .h-4-5 {
  437. height: 80%;
  438. }
  439. .h-1-6 {
  440. height: 16.666667%;
  441. }
  442. .h-2-6 {
  443. height: 33.333333%;
  444. }
  445. .h-3-6 {
  446. height: 50%;
  447. }
  448. .h-4-6 {
  449. height: 66.666667%;
  450. }
  451. .h-5-6 {
  452. height: 83.333333%;
  453. }
  454. .h-full {
  455. height: 100% !important;
  456. }
  457. .h-screen {
  458. height: 100vh;
  459. }
  460. // 宽度
  461. .w-1-2 {
  462. width: 50%;
  463. }
  464. .w-1-3 {
  465. width: 33.333333%;
  466. }
  467. .w-2-3 {
  468. width: 66.666667%;
  469. }
  470. .w-1-4 {
  471. width: 25%;
  472. }
  473. .w-2-4 {
  474. width: 50%;
  475. }
  476. .w-3-4 {
  477. width: 75%;
  478. }
  479. .w-1-5 {
  480. width: 20%;
  481. }
  482. .w-2-5 {
  483. width: 40%;
  484. }
  485. .w-3-5 {
  486. width: 60%;
  487. }
  488. .w-4-5 {
  489. width: 80%;
  490. }
  491. .w-1-6 {
  492. width: 16.666667%;
  493. }
  494. .w-2-6 {
  495. width: 33.333333%;
  496. }
  497. .w-3-6 {
  498. width: 50%;
  499. }
  500. .w-4-6 {
  501. width: 66.666667%;
  502. }
  503. .w-5-6 {
  504. width: 83.333333%;
  505. }
  506. .w-1-12 {
  507. width: 8.333333%;
  508. }
  509. .w-2-12 {
  510. width: 16.666667%;
  511. }
  512. .w-3-12 {
  513. width: 25%;
  514. }
  515. .w-4-12 {
  516. width: 33.333333%;
  517. }
  518. .w-5-12 {
  519. width: 41.666667%;
  520. }
  521. .w-6-12 {
  522. width: 50%;
  523. }
  524. .w-7-12 {
  525. width: 58.333333%;
  526. }
  527. .w-8-12 {
  528. width: 66.666667%;
  529. }
  530. .w-9-12 {
  531. width: 75%;
  532. }
  533. .w-10-12 {
  534. width: 83.333333%;
  535. }
  536. .w-11-12 {
  537. width: 91.666667%;
  538. }
  539. .w-full {
  540. width: 100% !important;
  541. }
  542. .w-screen {
  543. width: 100vh;
  544. }
  545. @for $i from 1 through 10 {
  546. $var: $i * 10;
  547. .w-#{$var} {
  548. width: #{$var + '%'};
  549. }
  550. }
  551. @for $i from 1 through 19 {
  552. $var: $i * 5;
  553. .w-#{$var} {
  554. width: #{$var + '%'};
  555. }
  556. }
  557. /* ============ 字体文本 ============*/
  558. // 大小
  559. // 数值形式(取偶数)
  560. @for $i from 10 through 50 {
  561. @if $i % 2 == 0 {
  562. .text-#{$i} {
  563. font-size: $i + px;
  564. }
  565. }
  566. }
  567. // 粗细
  568. .font-thin {
  569. font-weight: 100;
  570. }
  571. .font-extralight {
  572. font-weight: 200;
  573. }
  574. .font-light {
  575. font-weight: 300;
  576. }
  577. .font-normal {
  578. font-weight: 400;
  579. }
  580. .font-medium {
  581. font-weight: 500;
  582. }
  583. .font-semibold {
  584. font-weight: 600;
  585. }
  586. .font-bold {
  587. font-weight: 700;
  588. }
  589. .font-extrabold {
  590. font-weight: 800;
  591. }
  592. .font-black {
  593. font-weight: 900;
  594. }
  595. // 行高
  596. .leading-0 {
  597. line-height: 0 !important;
  598. }
  599. .leading-05 {
  600. line-height: 0.5 !important;
  601. }
  602. .leading-10 {
  603. line-height: 1 !important;
  604. }
  605. .leading-12 {
  606. line-height: 1.2 !important;
  607. }
  608. .leading-15 {
  609. line-height: 1.5 !important;
  610. }
  611. .leading-20 {
  612. line-height: 2 !important;
  613. }
  614. .leading-30 {
  615. line-height: 3 !important;
  616. }
  617. // 文本对齐
  618. .text-left {
  619. text-align: left !important;
  620. }
  621. .text-center {
  622. text-align: center !important;
  623. }
  624. .text-right {
  625. text-align: right !important;
  626. }
  627. .text-justify {
  628. text-align: justify !important;
  629. }
  630. // 文本溢出
  631. .line-1 {
  632. overflow: hidden;
  633. white-space: nowrap;
  634. text-overflow: ellipsis;
  635. }
  636. .line-2 {
  637. -webkit-line-clamp: 2;
  638. }
  639. .line-3 {
  640. -webkit-line-clamp: 3;
  641. }
  642. .line-4 {
  643. -webkit-line-clamp: 4;
  644. }
  645. .line-5 {
  646. -webkit-line-clamp: 5;
  647. }
  648. .line-2,
  649. .line-3,
  650. .line-4,
  651. .line-5 {
  652. overflow: hidden;
  653. word-break: break-all;
  654. text-overflow: ellipsis;
  655. display: -webkit-box; // 弹性伸缩盒
  656. -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式
  657. }
  658. // 换行
  659. .break-normal {
  660. overflow-wrap: normal;
  661. word-break: normal;
  662. }
  663. .break-words {
  664. overflow-wrap: break-word;
  665. } // 在长单词或 URL 地址内部进行换行
  666. .break-all {
  667. word-break: break-all;
  668. } // 在单词内换行
  669. // 文本修饰
  670. .underline {
  671. text-decoration-line: underline;
  672. }
  673. .overline {
  674. text-decoration-line: overline;
  675. }
  676. .line-through {
  677. text-decoration-line: line-through;
  678. }
  679. .no-underline {
  680. text-decoration-line: no-underline;
  681. }
  682. // 下划线位置
  683. .underline-offset-auto {
  684. text-underline-offset: auto;
  685. }
  686. .underline-offset-0 {
  687. text-underline-offset: 0px;
  688. }
  689. .underline-offset-1 {
  690. text-underline-offset: 1px;
  691. }
  692. .underline-offset-2 {
  693. text-underline-offset: 2px;
  694. }
  695. .underline-offset-4 {
  696. text-underline-offset: 4px;
  697. }
  698. .underline-offset-8 {
  699. text-underline-offset: 8px;
  700. }
  701. /* ============ 边框 ============*/
  702. // 圆角
  703. .rounded-none {
  704. border-radius: 0px;
  705. }
  706. .rounded {
  707. border-radius: 5px;
  708. }
  709. .rounded-10 {
  710. border-radius: 10px;
  711. }
  712. .rounded-20 {
  713. border-radius: 20px;
  714. }
  715. .rounded-30 {
  716. border-radius: 30px;
  717. }
  718. .rounded-50 {
  719. border-radius: 50px;
  720. }
  721. .rounded-circle {
  722. border-radius: 100%;
  723. }
  724. // 边框
  725. @each $var in left, right, top, bottom {
  726. // 边框,结果如:border-l
  727. .border-#{str-slice($var,0,1)} {
  728. border-#{$var}-width: 1px;
  729. border-#{$var}-style: solid;
  730. border-#{$var}-color: $border-color;
  731. }
  732. // 边框为0,结果如:border-l-0
  733. .border-#{str-slice($var,0,1)}-0 {
  734. border-#{$var}-width: 0;
  735. }
  736. }
  737. .border {
  738. border-width: 1px;
  739. border-style: solid;
  740. border-color: $border-color;
  741. }
  742. .border-0 {
  743. border-width: 0;
  744. }
  745. /* ============ 效果 ============*/
  746. // 阴影
  747. .shadow-sm {
  748. box-shadow: 0 2px 4px rgba(114, 130, 138, 0.2) !important;
  749. }
  750. .shadow {
  751. box-shadow: 0 8px 16px rgba(114, 130, 138, 0.2) !important;
  752. }
  753. .shadow-lg {
  754. box-shadow: 0 16px 48px rgba(114, 130, 138, 0.2) !important;
  755. }
  756. // 透明度
  757. .opacity-0 {
  758. opacity: 0;
  759. }
  760. .opacity-10 {
  761. opacity: 0.1;
  762. }
  763. .opacity-20 {
  764. opacity: 0.2;
  765. }
  766. .opacity-30 {
  767. opacity: 0.3;
  768. }
  769. .opacity-40 {
  770. opacity: 0.4;
  771. }
  772. .opacity-50 {
  773. opacity: 0.5;
  774. }
  775. .opacity-60 {
  776. opacity: 0.6;
  777. }
  778. .opacity-70 {
  779. opacity: 0.7;
  780. }
  781. .opacity-80 {
  782. opacity: 0.8;
  783. }
  784. .opacity-90 {
  785. opacity: 0.9;
  786. }
  787. .opacity-100 {
  788. opacity: 1;
  789. }