dark.less 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. .accessibility-focus-dark() {
  2. box-shadow: 0 0 0 2px @primary-7;
  3. }
  4. .@{menu-prefix-cls} {
  5. &&-root:focus-visible {
  6. .accessibility-focus-dark();
  7. }
  8. &-dark &-item,
  9. &-dark &-submenu-title {
  10. &:focus-visible {
  11. .accessibility-focus-dark();
  12. }
  13. }
  14. // dark theme
  15. &&-dark,
  16. &-dark &-sub,
  17. &&-dark &-sub {
  18. color: @menu-dark-color;
  19. background: @menu-dark-bg;
  20. .@{menu-prefix-cls}-submenu-title .@{menu-prefix-cls}-submenu-arrow {
  21. opacity: 0.45;
  22. transition: all 0.3s;
  23. &::after,
  24. &::before {
  25. background: @menu-dark-arrow-color;
  26. }
  27. }
  28. }
  29. &-dark&-submenu-popup {
  30. background: transparent;
  31. }
  32. &-dark &-inline&-sub {
  33. background: @menu-dark-inline-submenu-bg;
  34. }
  35. &-dark&-horizontal {
  36. border-bottom: 0;
  37. }
  38. &-dark&-horizontal > &-item,
  39. &-dark&-horizontal > &-submenu {
  40. top: 0;
  41. margin-top: 0;
  42. padding: @menu-item-padding;
  43. border-color: @menu-dark-bg;
  44. border-bottom: 0;
  45. }
  46. &-dark&-horizontal > &-item:hover {
  47. background-color: @menu-dark-item-active-bg;
  48. }
  49. &-dark&-horizontal > &-item > a::before {
  50. bottom: 0;
  51. }
  52. &-dark &-item,
  53. &-dark &-item-group-title,
  54. &-dark &-item > a,
  55. &-dark &-item > span > a {
  56. color: @menu-dark-color;
  57. }
  58. &-dark&-inline,
  59. &-dark&-vertical,
  60. &-dark&-vertical-left,
  61. &-dark&-vertical-right {
  62. border-right: 0;
  63. }
  64. &-dark&-inline &-item,
  65. &-dark&-vertical &-item,
  66. &-dark&-vertical-left &-item,
  67. &-dark&-vertical-right &-item {
  68. left: 0;
  69. margin-left: 0;
  70. border-right: 0;
  71. &::after {
  72. border-right: 0;
  73. }
  74. }
  75. &-dark&-inline &-item,
  76. &-dark&-inline &-submenu-title {
  77. width: 100%;
  78. }
  79. &-dark &-item:hover,
  80. &-dark &-item-active,
  81. &-dark &-submenu-active,
  82. &-dark &-submenu-open,
  83. &-dark &-submenu-selected,
  84. &-dark &-submenu-title:hover {
  85. color: @menu-dark-highlight-color;
  86. background-color: transparent;
  87. > a,
  88. > span > a {
  89. color: @menu-dark-highlight-color;
  90. }
  91. > .@{menu-prefix-cls}-submenu-title {
  92. > .@{menu-prefix-cls}-submenu-arrow {
  93. opacity: 1;
  94. &::after,
  95. &::before {
  96. background: @menu-dark-highlight-color;
  97. }
  98. }
  99. }
  100. }
  101. &-dark &-item:hover {
  102. background-color: @menu-dark-item-hover-bg;
  103. }
  104. &-dark&-dark:not(&-horizontal) &-item-selected {
  105. background-color: @menu-dark-item-active-bg;
  106. }
  107. &-dark &-item-selected {
  108. color: @menu-dark-highlight-color;
  109. border-right: 0;
  110. &::after {
  111. border-right: 0;
  112. }
  113. > a,
  114. > span > a,
  115. > a:hover,
  116. > span > a:hover {
  117. color: @menu-dark-highlight-color;
  118. }
  119. .@{menu-prefix-cls}-item-icon,
  120. .@{iconfont-css-prefix} {
  121. color: @menu-dark-selected-item-icon-color;
  122. + span {
  123. color: @menu-dark-selected-item-text-color;
  124. }
  125. }
  126. }
  127. &&-dark &-item-selected,
  128. &-submenu-popup&-dark &-item-selected {
  129. background-color: @menu-dark-item-active-bg;
  130. }
  131. // Disabled state sets text to dark gray and nukes hover/tab effects
  132. &-dark &-item-disabled,
  133. &-dark &-submenu-disabled {
  134. &,
  135. > a,
  136. > span > a {
  137. color: @disabled-color-dark !important;
  138. opacity: 0.8;
  139. }
  140. > .@{menu-prefix-cls}-submenu-title {
  141. color: @disabled-color-dark !important;
  142. > .@{menu-prefix-cls}-submenu-arrow {
  143. &::before,
  144. &::after {
  145. background: @disabled-color-dark !important;
  146. }
  147. }
  148. }
  149. }
  150. }