mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 16:09:31 +03:00
clock: revert removal of initial media query check
This commit restores a small check for a match of the query, so that when you load in dark mode, the clock loads in dark(ly). Without this commit, it would only shift modes as part of a media query change.
This commit is contained in:
parent
f4a06589c0
commit
e8b087ea87
@ -18,6 +18,11 @@ let text = "#000000", background = "#ffffff";
|
||||
|
||||
let dark = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
|
||||
if (dark.matches) {
|
||||
text = "#7f7f7f";
|
||||
background = "#333";
|
||||
}
|
||||
|
||||
function darkColors(dark) {
|
||||
if (dark.matches) {
|
||||
text = "#7f7f7f";
|
||||
@ -28,7 +33,7 @@ function darkColors(dark) {
|
||||
}
|
||||
}
|
||||
|
||||
dark.addListener(darkColors)
|
||||
dark.addListener(darkColors);
|
||||
|
||||
|
||||
const toRelativeTime = (date, referenceTime, unit) => moment(date)
|
||||
|
Loading…
Reference in New Issue
Block a user