Skip to content
Discussion options

You must be logged in to vote

You can use Tailwind's "dark" prefix to switch classes based on dark mode:

ui.label('Label').classes('bg-red-400 dark:bg-blue-400')

For buttons, however, it doesn't seem to work like this. But there's a way to switch the "color" prop based on dark mode:

ui.button('Button').props(''':color="Quasar.Dark.isActive ? 'blue' : 'red'"''')

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by wurstcasesenario
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants