qalendar: color-scheme: light not working
Context :
- Browser : Edge
- Qalendar Version v.3.5.0
**Describe the bug ** I have set my computer to dark mode and I want Qalendar to apply light mode, so I wrote the following code.
<template>
<v-card min-height="">
<v-card-title>
{{ t("eip.uploadedWorkHour") }}
</v-card-title>
<v-card-text style="color-scheme: light" >
<Qalendar :events="events" :config="config" style="min-height: 600px;" />
</v-card-text>
</v-card>
</template>
but my Qalendar still dark, Is there an error in my configuration method? Thank you.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 5
- Comments: 16 (7 by maintainers)
Hey all. Thanks a lot for engaging, and even coming up with great workarounds.
I think I finally, after my third round of coming back to this problem, found a solution which won’t make me have to rebuild the whole dark mode feature. For anyone wanting to try the fix out, you can download
npm i qalendar@3.5.1-beta.0. I just solved it, but won’t have time to test it properly before I go on vacation for a couple of weeks. This means a beta release will have to do for now.Once you’ve downloaded this version, add an
"is-light-mode"class to any wrapping element, and now it should work. Not the optimal API, I admit, but will also have to do for now in order to avoid breaking changes.An example of the implementation can be found here: https://github.com/tomosterlund/qalendar-light-mode-test/blob/main/src/views/Home.vue
Until the issue itself gets resolved, I’ve tried to manually “hack” some of the CSS and the way I did was really amateurish but for everyone else that can’t wait/want to try out this:
Here is the full CSS list that I use in my component (style scoped) to override the values:
Here is a snapshot with how it looks like:
I know it’s not a proper solution! Just laying out in case someone else really wants to just see it white, otherwise I would suggest to just wait on the fix.
Heya 😃 We are using qalendar@3.5.1-beta.0 with enforced light mode and it works like a charm 😃
@georgeVasiliu Thanks man!
@georgeVasiliu
No, you’re right. Adding a class and a config option is counterintuitive, and not what I meant either 😃 I meant adding a class, as an internal means of making this rule possible