Pavel Sarygin
Pavel Sarygin

Reputation: 27

CSS - Change font color of a string variable

I am trying to change color of the variable of the logged in username.

userData.name is a simple string returned from the API:

enter image description here

The issue is how it looks on the UI (you can barely see the name because it has black font):

enter image description here

Does anyone know how to add styles to userData.name variable so that it changes the font to white or some other color?

Thank you!

Upvotes: 0

Views: 288

Answers (1)

Sergiu
Sergiu

Reputation: 36

try to wrap it in a paragraph or something similar and then you can style that element

{auth ? (<p style={{color: 'white'}}>{userData.name}</p>) : <Button />}

Upvotes: 2

Related Questions