Home > OS >  CSS - Change font color of a string variable
CSS - Change font color of a string variable

Time:09-23

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!

CodePudding user response:

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 />}
  • Related