Conversation
this helps to know if the device is in dark mode or not
UI Tests Results 1 files 98 suites 4s ⏱️ For more details on these failures, see this check. Results for commit 2deb986. |
rstoenescu
left a comment
There was a problem hiding this comment.
Hi,
Thank you for contributing!
Please take a look at my comments. Would help with it, but I have no bandwidth for it at the moment.
You can test with "pnpm dev:ssr" and "pnpm dev" in /ui.
When you're ready, a "pnpm build" without errors would ensure it passes the shallow validation for JSON also.
|
|
||
| const matchMedia = window.matchMedia('(prefers-color-scheme: dark)') | ||
| Plugin.mode = val | ||
| Plugin.isEnabled = matchMedia.matches |
There was a problem hiding this comment.
isPreferred would be better otherwise it is confusing
There was a problem hiding this comment.
ok i will update this
|
|
||
| if (__QUASAR_SSR_SERVER__) { | ||
| this.isActive = dark === true | ||
| this.isEnabled = matchMedia.matches |
There was a problem hiding this comment.
There is no matchMedia here, nor can it be. This code runs on the server. It should be defaulted to a value (probably false) and updated only on client takeover, otherwise there will be hydration errors.
| import { createReactivePlugin } from '../../utils/private.create/create.js' | ||
|
|
||
| const Plugin = createReactivePlugin({ | ||
| isEnabled: false, |
There was a problem hiding this comment.
Should be added to Dark.json too.
There was a problem hiding this comment.
I did that on but i will update it to isPreferred
|
Closing as #17672 seems to be the updated version of this. |
this helps to know if the device is in dark mode or not
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
devbranch (orv[X]branch)fix: #xxx[,#xxx], where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information: