common.scss 2.2 KB

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