custom-theme.scss 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. // 自定义主题变量
  2. $custom-primary: #667eea;
  3. $custom-secondary: #764ba2;
  4. $custom-success: #4cd964;
  5. $custom-warning: #f0ad4e;
  6. $custom-error: #dd524d;
  7. $custom-info: #5bc0de;
  8. // 背景色
  9. $custom-bg-primary: #ffffff;
  10. $custom-bg-secondary: #f8f8f8;
  11. $custom-bg-tertiary: #f5f5f5;
  12. $custom-bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  13. // 文字颜色
  14. $custom-text-primary: #333333;
  15. $custom-text-secondary: #666666;
  16. $custom-text-tertiary: #999999;
  17. $custom-text-white: #ffffff;
  18. // 边框颜色
  19. $custom-border-primary: #e5e5e5;
  20. $custom-border-secondary: #ddd;
  21. $custom-border-disabled: #ccc;
  22. // 禁用状态
  23. $custom-bg-disabled: #f5f5f5;
  24. $custom-text-disabled: #999999;
  25. // 按钮样式
  26. $custom-btn-height: 32px;
  27. $custom-btn-radius: 4px;
  28. $custom-btn-font-size: 12px;
  29. // 输入框样式
  30. $custom-input-height: 32px;
  31. $custom-input-radius: 4px;
  32. $custom-input-border: 1px solid #e5e5e5;
  33. // 导航栏样式
  34. $custom-nav-height: 50px;
  35. $custom-nav-bg: #ffffff;
  36. $custom-nav-active-bg: #e0e0e0;
  37. // 状态栏样式
  38. $custom-status-height: 44px;
  39. $custom-footer-height: 40px;
  40. // 间距
  41. $custom-spacing-xs: 5px;
  42. $custom-spacing-sm: 10px;
  43. $custom-spacing-md: 15px;
  44. $custom-spacing-lg: 20px;
  45. // 圆角
  46. $custom-radius-sm: 4px;
  47. $custom-radius-md: 8px;
  48. $custom-radius-lg: 12px;
  49. // 阴影
  50. $custom-shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
  51. $custom-shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.15);
  52. $custom-shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.2);
  53. // 动画
  54. $custom-transition: all 0.3s ease;
  55. // 响应式断点
  56. $custom-breakpoint-sm: 576px;
  57. $custom-breakpoint-md: 768px;
  58. $custom-breakpoint-lg: 992px;
  59. $custom-breakpoint-xl: 1200px;
  60. // 混合器
  61. @mixin flex-center {
  62. display: flex;
  63. align-items: center;
  64. justify-content: center;
  65. }
  66. @mixin flex-between {
  67. display: flex;
  68. align-items: center;
  69. justify-content: space-between;
  70. }
  71. @mixin flex-start {
  72. display: flex;
  73. align-items: center;
  74. justify-content: flex-start;
  75. }
  76. @mixin gradient-bg {
  77. background: $custom-bg-gradient;
  78. }
  79. @mixin card-style {
  80. background-color: $custom-bg-primary;
  81. border-radius: $custom-radius-md;
  82. box-shadow: $custom-shadow-light;
  83. padding: $custom-spacing-md;
  84. }
  85. @mixin button-style($type: 'default') {
  86. height: $custom-btn-height;
  87. border-radius: $custom-btn-radius;
  88. font-size: $custom-btn-font-size;
  89. transition: $custom-transition;
  90. @if $type == 'primary' {
  91. background-color: $custom-primary;
  92. color: $custom-text-white;
  93. } @else if $type == 'secondary' {
  94. background-color: $custom-secondary;
  95. color: $custom-text-white;
  96. } @else if $type == 'success' {
  97. background-color: $custom-success;
  98. color: $custom-text-white;
  99. } @else if $type == 'warning' {
  100. background-color: $custom-warning;
  101. color: $custom-text-white;
  102. } @else if $type == 'error' {
  103. background-color: $custom-error;
  104. color: $custom-text-white;
  105. } @else if $type == 'info' {
  106. background-color: $custom-info;
  107. color: $custom-text-white;
  108. } @else {
  109. background-color: $custom-bg-secondary;
  110. color: $custom-text-secondary;
  111. border: 1px solid $custom-border-secondary;
  112. }
  113. }
  114. @mixin input-style {
  115. height: $custom-input-height;
  116. border-radius: $custom-input-radius;
  117. border: $custom-input-border;
  118. padding: 0 $custom-spacing-sm;
  119. font-size: 14px;
  120. transition: $custom-transition;
  121. &:focus {
  122. border-color: $custom-primary;
  123. box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
  124. }
  125. }
  126. // 响应式工具类
  127. @mixin responsive($breakpoint) {
  128. @if $breakpoint == sm {
  129. @media (min-width: $custom-breakpoint-sm) { @content; }
  130. } @else if $breakpoint == md {
  131. @media (min-width: $custom-breakpoint-md) { @content; }
  132. } @else if $breakpoint == lg {
  133. @media (min-width: $custom-breakpoint-lg) { @content; }
  134. } @else if $breakpoint == xl {
  135. @media (min-width: $custom-breakpoint-xl) { @content; }
  136. }
  137. }