76
Views
10
Comments
Change the text color of each event inside FullCalendar
Application Type
Traditional Web

Hello,


I was implementing a full calendar for my outsystem project and I was trying to change the text color for each event in the calendar but the color that I'm inserting into the calendar is not being applied, does anyone know a way to fix this? 


The only colors that are being applied are black and white.

This is the link for the full calendar that I'm using:

https://fullcalendar.io/

And this is the code for each event that I'm inserting into the calendar:

The "textColor" is what defines the color of the text for each event, I have tried RGB, HEXA and plain text ('orange') but the color didn't change.

2024-09-09 08-44-46
BHUPENDRA SINGH

Hi,

Please check by changing property name "textColor" with  "eventTextColor" and assign the desire color.

hope this will help you.

UserImage.jpg
Helder Silva

Sorry, I should have mentioned that I also had tried the property name "eventTextColor" and it didn't work either.

2019-09-30 07-35-56
Aurelio Junior

Hi Helder,

I'm not very familiar with that calendar component, but I tried tweaking one of the examples available in their website and managed to successfully set the text color using the "textColor" attribute:

Did you inspect the generated HTML code to check if there isn't any CSS overriding the text color?

UserImage.jpg
Helder Silva

Hi Aurelio, I'm honestly not sure where to inspect in the HTML code to check if there is a CSS overriding the text color.


And while I while testing the textColor I noticed that it only changes to black or white if I place it like this: textColor: 'black' textColor:  'white', if I try in hexadecimal or RGB values it doesn't change the color (I'm using hexadecimal for the color output)

2019-09-30 07-35-56
Aurelio Junior

Hello,

Right click the event name in your app and select the "Inspect" option. You'll be taken to the developer tools where you can inspect the HTML.

In the example below, I can see that the text color is being set via the "style" property of the element with the "fc-event-main" class:

UserImage.jpg
Helder Silva

This is what I'm getting in the console, I tried to set the color of the text as 'red' but it got overrided.

2019-09-30 07-35-56
Aurelio Junior

Well there's your answer. That ".black" class is overriding the color you're setting for the events. You can try to change that CSS to be less specific or remove that class entirely from your element and always set the color via the "textColor" attribute.

UserImage.jpg
Helder Silva

Could you tell me how to do that? I'm not not very knowledgeable in CSS.

2019-09-30 07-35-56
Aurelio Junior

It's really hard for me to suggest how to do that without looking at your code. That class is probably being used elsewhere, so you have to be careful when changing it to avoid breaking other screens.

2023-03-31 06-39-46
Asad Sheikh

Hi @Helder Silva 

Can you please share the OML


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.