[SalesForce] LWC- Datatable apply css in the text content

I have a datatable in lwc. For one of the column I am setting the style class to – 'slds-icon-custom-custom9' which changes the text content of that column to white.When I hover cursor , text becomes invisible because background as well text is white.

Is there a way, I can change the text content of a cell to be black when using 'slds-icon-custom-custom9' ? I tried using style through basic.css file, but it's style won't apply to the cell of the datatable.

If I don't use – slds-icon-custom-custom9 , how do I change the background color of the cell ?

Playground link- https://developer.salesforce.com/docs/component-library/tools/playground/kPSqiPxWk/58/edit

Best Answer

Yes you can add another class for font color black like this

ele.AttributeName = 'slds-icon-custom-custom9 slds-text-color_default';

here is PG https://developer.salesforce.com/docs/component-library/tools/playground/kPSqiPxWk/62/edit