Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
website(docs): set color-scheme on the root element (#3721)
Browse files Browse the repository at this point in the history
  • Loading branch information
nstepien authored Nov 14, 2022
1 parent de7b7a0 commit 501dbe9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions website/src/styles/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,15 @@ a, .link {
}
}

html {
:root {
scroll-padding-top: 80px;
color-scheme: light only;

@include mobile-only {
scroll-padding-top: 64px;
}
}

input {
color-scheme: light;

@include dark-mode {
color-scheme: dark;
}
@include dark-mode {
color-scheme: dark only;
}
4 changes: 2 additions & 2 deletions website/src/styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
}

@mixin dark-mode {
@at-root html[data-theme='dark'] #{if(&, "&", "")} {
@at-root :root[data-theme='dark'] #{if(&, "&", "")} {
@content;
}

@media (prefers-color-scheme: dark) {
@at-root html[data-theme='auto'] #{if(&, "&", "")} {
@at-root :root[data-theme='auto'] #{if(&, "&", "")} {
@content;
}
}
Expand Down

0 comments on commit 501dbe9

Please sign in to comment.