It’s probably down to odd CSS black magic, but I’m noticing that using the CSS injection to get calendar event coloring to work is only working for the background color - the foreground color is being ignored/overridden by the default for the theme. Using the browser’s inspector shows the color: element of the custom CSS crossed out.
Our app allows users to set what color they’d like to have for any visit type - so I’ve just got a bunch of test visit types put in - here’s the CSS injected for one of them:
It appears that the default styles have more specific css selector .v-calendar-week-wrapper .v-calendar-event, so that they have priority over your styles.
In simple case, you can add .v-calendar-week-wrapper to your css selector, e.g.: .v-calendar-week-wrapper .v-calendar-event-vtcolor-Orange {...}.
Altenatively, you can write something as follows (where event-red is my customs style name):
This also did not work until I preprended .hover to everything. Then it works. So what works is the above quoted 2 blocks, but with .hover preprended to the selectors.
The styles are not in a CSS file at all - they are injected at runtime. We cannot put them in a CSS file as users configure by visit type what color they would like visits with a particular visit type to show in. So the styles have to be runtime injected.
I’m using Page.getCurrent().getStyles().add(...) as numerous examples show.
Well, I have it working already - just needed the prepend of .hover to make it work. The other way may be limiting as some of our clients have dozens (and a couple have hundreds) of visit types and make use of some pretty unique colors. The problem is this is a conversion and some of our clients date to 1994… and they’re used to certain things.