_dark.scss 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. @use "sass:color";
  2. // stylelint-disable declaration-no-important
  3. @if $enable-dark-mode {
  4. :root {
  5. &:not(.theme-dark):not([data-bs-theme="dark"]) {
  6. .hide-theme-light {
  7. display: none !important;
  8. }
  9. .img-dark {
  10. display: none !important;
  11. }
  12. }
  13. &.theme-dark,
  14. &[data-bs-theme="dark"] {
  15. .hide-theme-dark {
  16. display: none !important;
  17. }
  18. .img-light {
  19. display: none !important;
  20. }
  21. }
  22. }
  23. @include color-mode(dark, true) {
  24. color-scheme: dark;
  25. --#{$prefix}body-color: var(--#{$prefix}gray-200);
  26. --#{$prefix}secondary: var(--#{$prefix}gray-400);
  27. --#{$prefix}body-bg: var(--#{$prefix}gray-900);
  28. --#{$prefix}emphasis-color: #{$body-emphasis-color-dark};
  29. --#{$prefix}emphasis-color-rgb: #{to-rgb($body-emphasis-color-dark)};
  30. --#{$prefix}bg-forms: var(--#{$prefix}gray-900);
  31. --#{$prefix}bg-surface: var(--#{$prefix}gray-800);
  32. --#{$prefix}bg-surface-inverted: var(--#{$prefix}gray-100);
  33. --#{$prefix}bg-surface-secondary: var(--#{$prefix}gray-900);
  34. --#{$prefix}bg-surface-tertiary: var(--#{$prefix}gray-800);
  35. --#{$prefix}text-inverted: var(--#{$prefix}gray-800);
  36. --#{$prefix}link-color: var(--#{$prefix}primary);
  37. --#{$prefix}link-hover-color: color-mix(in srgb, var(--#{$prefix}primary), black 20%);
  38. --#{$prefix}active-bg: #{$lighten-dark};
  39. --#{$prefix}disabled-color: #{color-transparent(var(--#{$prefix}body-color), .4)};
  40. --#{$prefix}border-color: var(--#{$prefix}gray-700);
  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. .navbar-brand-autodark {
  50. .navbar-brand-image {
  51. @include autodark-image;
  52. }
  53. }
  54. }
  55. body[data-bs-theme=dark] [data-bs-theme=light] {
  56. @extend [data-bs-theme=dark];
  57. }
  58. }