_dark.scss 2.2 KB

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