Issue with Setting Tailwind and CSS Color Codes in ui.chip Color Property #3189
-
QuestionHello, I've been exploring the ui.chip component as documented here: ui.chip documentation, which mentions that the color property can accept Quasar, Tailwind, or CSS color codes. Using Quasar color values like pink-5 and yellow-7 works perfectly. However, I encounter issues when trying to use Tailwind color values or CSS color codes like #jre921. These do not seem to display correctly. I am wondering how to properly use Tailwind and CSS color values with the color property of the ui.chip component? Thank you for any suggestions! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @happybeginning1, All three colors seem to work: ui.chip('Quasar', color='red-5')
ui.chip('Tailwind', color='red-500')
ui.chip('CSS', color='#ff0000') ![]() I don't understand what kind of color |
Beta Was this translation helpful? Give feedback.
Oh dear, coloring Quasar elements can be so tricky... 😕
The color "white" isn't recognized as Quasar color, because it isn't mentioned in the Quasar color palette. That's why NiceGUI uses a Tailwind class for the text color, which doesn't affect the icon. But you can explicitly use the Quasar prop "text-color" to set text and icon color to white:
Maybe there's a better way to recognize Quasar colors. I'm open for suggestions.