Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilize native CSS variables #1759

Open
shaman-apprentice opened this issue Jan 29, 2025 · 1 comment
Open

Utilize native CSS variables #1759

shaman-apprentice opened this issue Jan 29, 2025 · 1 comment

Comments

@shaman-apprentice
Copy link

Is your feature request related to a problem? Please describe

I would like to switch between dark and light theme based on a css selector. I don't want to be forced to use scss.

Describe the solution you'd like

I want to be able to style the calendar through native CSS variables. Then I can add to my css something like .dark { --cal-bg-primary: black; }

Describe your use case for implementing this feature

When a user toggles between dark and light theme, everything in my app is styled immediately based on CSS variables but this calendar.

Additional context

In the case you are open for a contribution, I would like to open a PR, which migrates the scss variables to native CSS variables.

I have already tested it locally: I copied all .scss files, replaced the scss colors map through variables with the name-schema of $cal-event-color-primary -> var(--cal-event-color-primary) and compiled it to native CSS to test it works as intended. The only thing I could not migrate 1:1 was the scss color.adjust [...] lightness: -5%, which I replaced through a opacity: 95%;

I assume, this would be a major change, in the case the scss colors map is meant to be public API, as I had to replace it completely. Or do you know of a way, how to utilize native CSS variables in scss variables?

Please let me know, what you think.

And thanks for your great library!

@matts-bot
Copy link

matts-bot bot commented Jan 29, 2025

Thanks so much for opening an issue! If you'd like to support this project, then please consider sponsoring me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant