Change text color of Data grid cell

Hi everyone,

Can somebody please help. I would like to change the text color of a data grid cell inside OnCellRenderer()

I have tried these things but it did not help:

  1. added args.Attributes.Add("class", "white-text"); to OnCellRenderer and added CSS for white-text to the same component's CSS class and also to the general CSS class but none of them helped. Where should I add that class?

  2. added args.Attributes.Add("style", $"color: {(args.Data.Stop < DateTime.UtcNow ? "white" : "black")} !important;"); problem with this one is that it cannot override the color even with the !important added.
    Screenshot_1

I would like to add all of the style-related changes in one place rather than both on the template and on the code.