common.scss 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* 解决 h1 标签在 webkit 内核浏览器中文字大小失效问题 */
  2. :-webkit-any(article, aside, nav, section) h1 {
  3. font-size: 2em;
  4. }
  5. /* flex */
  6. .flx-center {
  7. display: flex;
  8. align-items: center;
  9. justify-content: center;
  10. }
  11. .flx-justify-between {
  12. display: flex;
  13. align-items: center;
  14. justify-content: space-between;
  15. }
  16. .flx-align-center {
  17. display: flex;
  18. align-items: center;
  19. }
  20. /* clearfix */
  21. .clearfix::after {
  22. display: block;
  23. height: 0;
  24. overflow: hidden;
  25. clear: both;
  26. content: '';
  27. }
  28. /* 文字单行省略号 */
  29. .sle {
  30. font-size: 13px;
  31. overflow: hidden;
  32. text-overflow: ellipsis;
  33. white-space: nowrap;
  34. }
  35. /* 文字多行省略号 */
  36. .mle {
  37. display: -webkit-box;
  38. overflow: hidden;
  39. -webkit-box-orient: vertical;
  40. -webkit-line-clamp: 2;
  41. }
  42. /* 文字多了自动換行 */
  43. .break-word {
  44. word-break: break-all;
  45. word-wrap: break-word;
  46. }
  47. /* fade-transform */
  48. .fade-transform-leave-active,
  49. .fade-transform-enter-active {
  50. transition: all 0.2s;
  51. }
  52. .fade-transform-enter-from {
  53. opacity: 0;
  54. transition: all 0.2s;
  55. transform: translateX(-30px);
  56. }
  57. .fade-transform-leave-to {
  58. opacity: 0;
  59. transition: all 0.2s;
  60. transform: translateX(30px);
  61. }
  62. /* breadcrumb-transform */
  63. .breadcrumb-enter-active {
  64. transition: all 0.2s;
  65. }
  66. .breadcrumb-enter-from,
  67. .breadcrumb-leave-active {
  68. opacity: 0;
  69. transform: translateX(10px);
  70. }
  71. /* scroll bar */
  72. ::-webkit-scrollbar {
  73. width: 6px;
  74. height: 6px;
  75. }
  76. ::-webkit-scrollbar-thumb {
  77. background-color: var(--el-border-color-darker);
  78. border-radius: 20px;
  79. }
  80. /* nprogress */
  81. #nprogress .bar {
  82. background: var(--el-color-primary) !important;
  83. }
  84. #nprogress .spinner-icon {
  85. border-top-color: var(--el-color-primary) !important;
  86. border-left-color: var(--el-color-primary) !important;
  87. }
  88. #nprogress .peg {
  89. box-shadow:
  90. 0 0 10px var(--el-color-primary),
  91. 0 0 5px var(--el-color-primary) !important;
  92. }
  93. /* 外边距、内边距全局样式 */
  94. @for $i from 0 through 100 {
  95. .mt#{$i} {
  96. margin-top: #{$i}px !important;
  97. }
  98. .mr#{$i} {
  99. margin-right: #{$i}px !important;
  100. }
  101. .mb#{$i} {
  102. margin-bottom: #{$i}px !important;
  103. }
  104. .ml#{$i} {
  105. margin-left: #{$i}px !important;
  106. }
  107. .pt#{$i} {
  108. padding-top: #{$i}px !important;
  109. }
  110. .pr#{$i} {
  111. padding-right: #{$i}px !important;
  112. }
  113. .pb#{$i} {
  114. padding-bottom: #{$i}px !important;
  115. }
  116. .pl#{$i} {
  117. padding-left: #{$i}px !important;
  118. }
  119. }