global.less 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. @primary-color: #2152d1;
  2. @success-color: #52C41A;
  3. @warning-color: #FAAD14;
  4. @error-color: #FF4D4F;
  5. @text-color: #303133;
  6. @border-color: #DCDFE6;
  7. @background-color: #F7F8FA;
  8. @font-size-base: 14px;
  9. @border-radius-base: 4px;
  10. @border-radius-large: 12px;
  11. *,
  12. *::before,
  13. *::after {
  14. box-sizing: border-box;
  15. }
  16. html,
  17. body {
  18. width: 100%;
  19. height: 100%;
  20. padding: 0;
  21. margin: 0;
  22. }
  23. #root {
  24. height: 100%;
  25. width: 100%;
  26. font-size: @font-size-base;
  27. color: @text-color;
  28. // Ant-Design主题-属性
  29. --primary-color: @primary-color;
  30. --text-color: @text-color;
  31. --border-radius: @border-radius-base;
  32. }
  33. p {
  34. margin: 0;
  35. }
  36. a,
  37. a:hover,
  38. a:active {
  39. cursor: pointer;
  40. font-size: @font-size-base;
  41. color: @primary-color;
  42. text-decoration: none;
  43. }
  44. ul {
  45. margin: 0;
  46. padding: 0;
  47. }
  48. ul li {
  49. list-style-type: none;
  50. }
  51. .text-primary,
  52. .text-primary:hover {
  53. color: @primary-color;
  54. }
  55. .text-success,
  56. .text-success:hover {
  57. color: @success-color;
  58. }
  59. .text-warning,
  60. .text-warning:hover {
  61. color: @warning-color;
  62. }
  63. .text-error,
  64. .text-error:hover {
  65. color: @error-color;
  66. }
  67. .router-lazyLoad {
  68. position: absolute;
  69. top: 50%;
  70. left: 50%;
  71. transform: translate(-50%, -50%);
  72. }
  73. // Ant-Design主题
  74. .ant-menu-inline {
  75. border: none !important;
  76. }
  77. .ant-menu-inline-collapsed {
  78. border: none !important;
  79. }
  80. // 导航菜单选中项背景色
  81. .ant-menu-item-selected {
  82. background-color: #e6f7ff !important;
  83. }
  84. .ant-menu-item-active {
  85. background-color: #e6f7ff !important;
  86. }
  87. // 确保选中状态的样式优先级
  88. .ant-menu-inline .ant-menu-item-selected {
  89. background-color: #e6f7ff !important;
  90. }
  91. .ant-menu-inline .ant-menu-item-active {
  92. background-color: #e6f7ff !important;
  93. }
  94. // 为选中状态添加额外的样式以确保效果
  95. .ant-menu-inline .ant-menu-item-selected,
  96. .ant-menu-inline .ant-menu-item-active {
  97. background-color: #e6f7ff !important;
  98. border-left: 4px solid #1890ff !important;
  99. color: #1890ff !important;
  100. }
  101. // 禁用
  102. //.ant-form-item {
  103. // margin-bottom: 16px !important;
  104. //}
  105. // 全局按钮样式
  106. .ant-btn-primary {
  107. background: #1890ff;
  108. border: 1px solid #1890ff;
  109. color: #ffffff;
  110. transition: all 0.3s ease;
  111. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  112. &:hover {
  113. background: #40a9ff;
  114. border-color: #40a9ff;
  115. color: #ffffff;
  116. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  117. transform: translateY(-1px);
  118. }
  119. &:active {
  120. background: #096dd9;
  121. border-color: #096dd9;
  122. color: #ffffff;
  123. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  124. transform: translateY(0);
  125. }
  126. &:focus {
  127. background: #1890ff;
  128. border-color: #1890ff;
  129. color: #ffffff;
  130. box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
  131. }
  132. &:disabled {
  133. background: #f5f5f5;
  134. border-color: #d9d9d9;
  135. color: rgba(0, 0, 0, 0.25);
  136. box-shadow: none;
  137. transform: none;
  138. }
  139. }