-
-
Notifications
You must be signed in to change notification settings - Fork 876
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
Please allow styling of event colors with css variables by switching to ngStyle #845
Comments
Hey, apologies for the late reply, I tried to do |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
Hi Matthew,
|
It doesn't work for me: https://stackblitz.com/edit/angular-fzjdae?file=demo/template.html Can you show me an example of it working? |
https://stackblitz.com/edit/angular-fzjdae-xrmgys?file=demo%2Ftemplate.html at first we define css variables in styles.css
then assign them to colors object (wrapped in var())
and last step is to assign colors obj properties to our dom element
I think it will be useful in projects with multiple themes - just save css variables of calendar event objects |
Ahhh, I see what I was doing wrong now, I missed off the |
Fixed in |
thank you, it works now! |
Hi Matthew
Would it be possible to switch the css attribute used for styling an event color and border to use the angular notation? Doing this would allow an end-user to leverage css variables and make our css less hard coded.
For example within the calendar-week-view-event-component.ts, you will find
<div class="cal-event" [style.backgroundColor]="weekEvent.event.color?.secondary" [style.borderColor]="weekEvent.event.color?.primary" ....
Ideally, we would like to see:
<div class="cal-event" [ngStyle.backgroundColor]="weekEvent.event.color?.secondary" [ngStyle.borderColor]="weekEvent.event.color?.primary" ...
This would allow us to change our css file from say:
Blue: { primary: '#89CFF0', // --nw-color-spectrum-blue-light secondary: '#B3F0FE' // --nw-color-brand-1 }
to:
Blue: { primary: 'var(--nw-color-spectrum-blue-light)', secondary: 'var(--nw-color-brand-1)' }
Does that make sense? Please let me know if you need additional info.
Thanks,
Robert.
Minimal reproduction of the problem with instructions
Versions
angular-calendar
:The text was updated successfully, but these errors were encountered: