Keine Beschreibung

style-dark-mode.scss 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* OS dark theme preference */
  2. @media only screen {
  3. .is-dark-theme.is-dark-theme {
  4. --global--color-background: var(--global--color-dark-gray);
  5. --global--color-primary: var(--global--color-light-gray);
  6. --global--color-secondary: var(--global--color-light-gray);
  7. --button--color-text: var(--global--color-background);
  8. --button--color-text-hover: var(--global--color-secondary);
  9. --button--color-text-active: var(--global--color-secondary);
  10. --button--color-background: var(--global--color-secondary);
  11. --button--color-background-active: var(--global--color-background);
  12. --global--color-border: #9ea1a7;
  13. /* Block: Table */
  14. --table--stripes-border-color: rgba(240, 240, 240, 0.15);
  15. --table--stripes-background-color: rgba(240, 240, 240, 0.15);
  16. }
  17. .is-dark-theme img {
  18. filter: brightness(.85) contrast(1.1);
  19. }
  20. .respect-color-scheme-preference.is-dark-theme body {
  21. background-color: var(--global--color-background);
  22. }
  23. #dark-mode-toggler {
  24. cursor: pointer;
  25. display: flex;
  26. align-items: center;
  27. justify-content: center;
  28. font-size: var(--global--font-size-xs);
  29. padding: 0.5em;
  30. min-height: 44px; // A11y requirement for minimum clickable area.
  31. min-width: max-content;
  32. border: 2px solid currentColor;
  33. box-shadow: none;
  34. background: var(--button--color-text);
  35. color: var(--button--color-background);
  36. z-index: 9998;
  37. .no-js & {
  38. display: none;
  39. }
  40. &.fixed-bottom {
  41. position: fixed;
  42. bottom: 5px;
  43. right: 5px;
  44. transition: bottom 0.5s;
  45. &.hide:not(:focus) {
  46. bottom: -80px;
  47. }
  48. }
  49. &.relative {
  50. position: absolute;
  51. height: 44px;
  52. top: calc(2.4 * var(--global--spacing-vertical) - 44px);
  53. right: calc(50vw - var(--responsive--alignwide-width) / 2 - 0.5em);
  54. .admin-bar & {
  55. top: calc(2.4 * var(--global--spacing-vertical) - 44px + 32px);
  56. @media only screen and (max-width: 782px) {
  57. top: calc(2.4 * var(--global--spacing-vertical) - 44px + 46px);
  58. }
  59. @media only screen and (max-width: 481px) {
  60. top: calc(2.4 * var(--global--spacing-vertical) - 44px + 26px);
  61. }
  62. }
  63. ~ nav {
  64. body:not(.primary-navigation-open) & {
  65. @media only screen and (max-width: 481px) {
  66. top: calc(44px + 44px);
  67. }
  68. }
  69. }
  70. }
  71. .primary-navigation-open & {
  72. display: none;
  73. }
  74. &:hover,
  75. &:focus {
  76. color: var(--button--color-background-active);
  77. border: 2px solid var(--button--color-text-active);
  78. background-color: var(--button--color-text-active);
  79. }
  80. .is-IE & {
  81. display: none;
  82. }
  83. }
  84. }