vkurko / calendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views
https://vkurko.github.io/calendar/
MIT License
1.23k stars 108 forks source link

Event Text Color #116

Closed stackasaur closed 1 year ago

stackasaur commented 1 year ago

So it doesn't seem there is an out-of-the-box option for setting Event text color?

I believe this would be a better use of the color attribute currently aliases the background color to more align with CSS property names. But to not cause any breaking changing, I propose textColor as an attribute name.

Alternatively, event could take in a list/string of class names or styles to apply.

My thought is that basing the text color entirely on the event class through theming really limits the number of colors you can have for events.

If I'm missing an easier way to do this currently, please let me know, but otherwise, I could work on this change.

vkurko commented 1 year ago

I think you want this FullCalendar setting in the Event Calendar. I'll try to add it in the next release.

stackasaur commented 1 year ago

@vkurko , related to this enhancement, I ran across a use case where having a className attribute for Event was really helpful. It allows the ability to dynamically group styling for related events. In my use case, I'm using it to change the title size of "important" events.

I added the functionality to my forked repository. I can't make up my mind whether the attribute should be a string or array of strings though. I made it a string to align with the theming convention.

Any thoughts?

vkurko commented 1 year ago

@stackasaur Thanks a lot for your contribution. I don't have a chance to review your PR right now, so give me some more time please. I would also prefer separate PRs for each new feature.

vkurko commented 1 year ago

Thanks to @stackasaur this was implemented in v1.1.0.

darkvovich commented 1 month ago

Hi! className / classNames in event obj not working for me

try to add as string and as array of classes

How to use it's correctly?

vkurko commented 4 weeks ago

How to use it's correctly?

Here I added the TEST class to the event with the text The calendar can display background and regular events. So it's just className: "TEST".