common.scss 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. /** S 背景颜色 **/
  2. .bg-primary { background-color: $--color-primary; }
  3. .bg-white { background-color: $--color-white; }
  4. .bg-body { background-color: $--background-color-base; }
  5. /** E 背景颜色 **/
  6. /** S 字体颜色 **/
  7. .primary { color: $--color-primary; }
  8. .black { color: $--color-black; }
  9. .white { color: $--color-white; }
  10. .normal { color: $--color-text-primary; }
  11. .lighter { color: $--color-text-regular; }
  12. .muted { color: $--color-text-secondary; }
  13. /** E 字体颜色 **/
  14. .border-bottom {
  15. border-bottom: $--border-base;
  16. }
  17. .border-top {
  18. border-top: $--border-base;
  19. }
  20. .border-left {
  21. border-left: $--border-base;
  22. }
  23. .border-right {
  24. border-right: $--border-base;
  25. }
  26. .border {
  27. border: $--border-base;
  28. }
  29. // 字体字重
  30. @for $i from 100 through 900 {
  31. @if $i % 100 == 0 {
  32. .weight-#{$i} {
  33. font-weight: $i;
  34. }
  35. }
  36. }
  37. /** S 字体大小 **/
  38. .xxl { font-size: 18px; }
  39. .xl { font-size: 17px; }
  40. .lg { font-size: 16px; }
  41. .md { font-size: 15px; }
  42. .nr { font-size: 14px; }
  43. .sm { font-size: 13px; }
  44. .xs { font-size: 12px; }
  45. .xxs { font-size: 11px; }
  46. // 字体大小[19-40]
  47. @for $i from 19 through 50 {
  48. .font-size-#{$i} {
  49. font-size: $i + px;
  50. }
  51. }
  52. /** E 字体大小 **/
  53. // 内、外边距[1-60]
  54. @for $i from 0 through 60 {
  55. // 只要偶数和能被5整除的数
  56. @if $i % 2 == 0 or $i % 5 == 0 {
  57. // 如:m-30
  58. .m-#{$i} {
  59. margin: $i + px;
  60. }
  61. // 如:p-30
  62. .p-#{$i} {
  63. padding: $i + px;
  64. }
  65. @each $short, $long in l left, t top, r right, b bottom {
  66. //如: m-l-6
  67. // 外边距
  68. .m-#{$short}-#{$i} {
  69. margin-#{$long}: $i + px;
  70. }
  71. //如: p-l-30
  72. // 内边距
  73. .p-#{$short}-#{$i} {
  74. padding-#{$long}: $i + px;
  75. }
  76. }
  77. }
  78. }
  79. // 行内块元素
  80. .inline { display: inline-block; }
  81. // 块元素
  82. .block { display: block; }
  83. // 触手
  84. .pointer { cursor: pointer }
  85. /** S 弹性布局 **/
  86. .flex {
  87. /* #ifndef APP-NVUE */
  88. display: flex;
  89. /* #endif */
  90. flex-direction: row;
  91. align-items: center;
  92. }
  93. .flex-col {
  94. /* #ifndef APP-NVUE */
  95. display: flex;
  96. /* #endif */
  97. flex-direction: column;
  98. }
  99. // 定义flex等分
  100. @for $i from 0 through 5 {
  101. .flex-#{$i} {
  102. flex: $i;
  103. }
  104. }
  105. .flex-none { flex: none; }
  106. .flex-wrap { flex-wrap: wrap; }
  107. .flex-nowrap { flex-wrap: nowrap; }
  108. .col-baseline { align-items: baseline; }
  109. .col-center { align-items: center; }
  110. .col-top { align-items: flex-start; }
  111. .col-bottom { align-items: flex-end; }
  112. .col-stretch { align-items:stretch; }
  113. .row-center { justify-content: center; }
  114. .row-left { justify-content: flex-start; }
  115. .row-right { justify-content: flex-end; }
  116. .row-between { justify-content: space-between; }
  117. .row-around { justify-content: space-around; }
  118. /** E 弹性布局 **/
  119. /** S 内容排序方式 **/
  120. .text-left { text-align: left; }
  121. .text-center { text-align: center; }
  122. .text-right { text-align: right; }
  123. /** E 内容排序方式 **/
  124. /** S 文本行数限制 **/
  125. .line-1 {
  126. overflow: hidden;
  127. white-space: nowrap;
  128. text-overflow: ellipsis;
  129. }
  130. .line-2 { -webkit-line-clamp: 2; }
  131. .line-3 { -webkit-line-clamp: 3; }
  132. .line-4 { -webkit-line-clamp: 4; }
  133. .line-5 { -webkit-line-clamp: 5; }
  134. .line-2, .line-3, .line-4, .line-5 {
  135. overflow: hidden;
  136. word-break: break-all;
  137. text-overflow: ellipsis;
  138. display: -webkit-box; // 弹性伸缩盒
  139. -webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式
  140. }
  141. /** E 文本行数限制 **/
  142. /* 中划线 */
  143. .line-through {
  144. text-decoration: line-through;
  145. }
  146. .clearfix:after{
  147. content: "";
  148. display: block;
  149. clear: both;
  150. visibility: hidden;
  151. }
  152. .wrapper1180 {
  153. width: 1180px;
  154. margin: 0 auto;
  155. }