variables.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // 主题色
  2. $primary-color: #1890ff;
  3. $success-color: #52c41a;
  4. $warning-color: #faad14;
  5. $error-color: #f5222d;
  6. // 文字颜色
  7. $text-color: rgba(0, 0, 0, 0.85);
  8. $text-color-secondary: rgba(0, 0, 0, 0.45);
  9. $disabled-color: rgba(0, 0, 0, 0.25);
  10. // 背景色
  11. $bg-color: #f0f2f5;
  12. $bg-color-light: #fafafa;
  13. // 边框颜色
  14. $border-color: #d9d9d9;
  15. $border-color-split: #f0f0f0;
  16. // 字体大小
  17. $font-size-base: 14px;
  18. $font-size-lg: 16px;
  19. $font-size-sm: 12px;
  20. // 圆角
  21. $border-radius-base: 2px;
  22. $border-radius-sm: 2px;
  23. $border-radius-lg: 4px;
  24. // 间距
  25. $spacing-unit: 8px;
  26. $spacing-xs: $spacing-unit;
  27. $spacing-sm: $spacing-unit * 2;
  28. $spacing-md: $spacing-unit * 3;
  29. $spacing-lg: $spacing-unit * 4;
  30. $spacing-xl: $spacing-unit * 5;
  31. // 阴影
  32. $box-shadow-base: 0 2px 8px rgba(0, 0, 0, 0.15);
  33. $box-shadow-card:
  34. 0 1px 2px -2px rgba(0, 0, 0, 0.16),
  35. 0 3px 6px 0 rgba(0, 0, 0, 0.12),
  36. 0 5px 12px 4px rgba(0, 0, 0, 0.09);
  37. // 响应式断点
  38. $screen-xs: 480px;
  39. $screen-sm: 576px;
  40. $screen-md: 768px;
  41. $screen-lg: 992px;
  42. $screen-xl: 1200px;
  43. $screen-xxl: 1600px;
  44. // 混合器
  45. @mixin flex-center {
  46. display: flex;
  47. align-items: center;
  48. justify-content: center;
  49. }
  50. @mixin text-ellipsis {
  51. overflow: hidden;
  52. text-overflow: ellipsis;
  53. white-space: nowrap;
  54. }
  55. @mixin multi-line-ellipsis($lines: 2) {
  56. display: -webkit-box;
  57. -webkit-box-orient: vertical;
  58. -webkit-line-clamp: $lines;
  59. overflow: hidden;
  60. }
  61. @mixin responsive($breakpoint) {
  62. @if $breakpoint == xs {
  63. @media (max-width: $screen-xs) {
  64. @content;
  65. }
  66. } @else if $breakpoint == sm {
  67. @media (max-width: $screen-sm) {
  68. @content;
  69. }
  70. } @else if $breakpoint == md {
  71. @media (max-width: $screen-md) {
  72. @content;
  73. }
  74. } @else if $breakpoint == lg {
  75. @media (max-width: $screen-lg) {
  76. @content;
  77. }
  78. } @else if $breakpoint == xl {
  79. @media (max-width: $screen-xl) {
  80. @content;
  81. }
  82. } @else if $breakpoint == xxl {
  83. @media (max-width: $screen-xxl) {
  84. @content;
  85. }
  86. }
  87. }
  88. // 函数
  89. @function rem($px) {
  90. @return calc($px / 16) + rem;
  91. }
  92. @function vw($px, $base: 375) {
  93. @return calc($px / $base * 100) + vw;
  94. }