_dark.scss 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // stylelint-disable declaration-no-important
  2. body {
  3. &:not(.theme-dark):not([data-bs-theme=dark]) {
  4. .hide-theme-light {
  5. display: none !important;
  6. }
  7. .img-dark {
  8. display: none !important;
  9. }
  10. }
  11. &.theme-dark,
  12. &[data-bs-theme=dark] {
  13. .hide-theme-dark {
  14. display: none !important;
  15. }
  16. .img-light {
  17. display: none !important;
  18. }
  19. }
  20. }
  21. @if $enable-dark-mode {
  22. @include color-mode(dark, true) {
  23. --#{$prefix}body-color: #{$body-color-dark};
  24. --#{$prefix}body-color-rgb: #{to-rgb($body-color-dark)};
  25. --#{$prefix}muted: #{$text-secondary-dark};
  26. --#{$prefix}body-bg: #{$darken-dark};
  27. --#{$prefix}body-bg-rgb: #{to-rgb($darken-dark)};
  28. --#{$prefix}emphasis-color: #{$body-emphasis-color-dark};
  29. --#{$prefix}emphasis-color-rgb: #{to-rgb($body-emphasis-color-dark)};
  30. --#{$prefix}bg-forms: #{$darken-dark};
  31. --#{$prefix}bg-surface: #{$dark};
  32. --#{$prefix}bg-surface-dark: #{$darken-dark};
  33. --#{$prefix}bg-surface-secondary: #{$lighten-dark};
  34. --#{$prefix}bg-surface-tertiary: #{$darken-dark};
  35. --#{$prefix}link-color: #{lighten($primary, 8%)};
  36. --#{$prefix}link-hover-color: #{$primary};
  37. --#{$prefix}active-bg: #{$lighten-dark};
  38. --#{$prefix}disabled-color: var(--#{$prefix}gray-700);
  39. --#{$prefix}border-color: var(--#{$prefix}dark-mode-border-color);
  40. --#{$prefix}border-color-translucent: var(
  41. --#{$prefix}dark-mode-border-color-translucent
  42. );
  43. --#{$prefix}border-dark-color: var(--#{$prefix}dark-mode-border-dark-color);
  44. --#{$prefix}border-active-color: var(
  45. --#{$prefix}dark-mode-border-active-color
  46. );
  47. --#{$prefix}btn-color: #{$darken-dark};
  48. --#{$prefix}code-color: var(--#{$prefix}body-color);
  49. --#{$prefix}code-bg: #{$border-dark-color-dark};
  50. @each $color, $value in $theme-colors {
  51. --#{$prefix}#{$color}-lt: #{theme-color-lighter($value, $dark)};
  52. --#{$prefix}#{$color}-lt-rgb: #{to-rgb(
  53. theme-color-lighter($value, $dark)
  54. )};
  55. }
  56. .navbar-brand-autodark {
  57. .navbar-brand-image {
  58. @include autodark-image;
  59. }
  60. }
  61. }
  62. body[data-bs-theme=dark] [data-bs-theme=light] {
  63. @extend [data-bs-theme=dark];
  64. }
  65. }