Please allow styling of event colors with css variables by switching to ngStyle
See original GitHub issueHi 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
:- Browser name and version: Chrome v71
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Fixed in
0.27.2
🎉thank you, it works now!