Can I match the same breakpoints for Quasar and Tailwind? #1333
-
QuestionHi All, I am trying to make the design responsive by using the breakpoint classes, so ex: for small screen the text size might be reduced, some things might not be visible, etc. My challenge is Quasar and TW has different definitions of the breakpoints. Is there a way I can edit them and make them the same? And also probably add a few more to make it more granular? I saw in their docs, that they allow to change these things from their configuration files, like the TW is in Thanks a lot, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @Anindya088, that's an interesting question. NiceGUI comes with the ability to set the Quasar config via from nicegui import globals
globals.quasar_config['screen'] = {
'xs': 400,
'sm': 600,
'md': 800,
'lg': 1000,
'xl': 1200,
}
with ui.element().classes('row'):
for i in range(12):
ui.label(f'Column {i + 1}').classes('col-xs-12 col-sm-6 col-md-4') But the breakpoints still seem to be the default 600px and 1024px. I'm not sure why. And regarding TailwindCSS, I also don't know how to change these breakpoints. Just for the record, you can use custom values for individual elements like this: ui.label('This message is red at 500px screen width.').classes('min-[500px]:text-red-400') |
Beta Was this translation helpful? Give feedback.
-
Thanks a ton @falkoschindler . I was struggling with the visibility classes from both Quasar and TW, and could not figure this one thing, basically how to hide/unhide things based on specific screen sizes. This solves a lot of my problems 😄 Thanks a lot, |
Beta Was this translation helpful? Give feedback.
With
min-[700px]:visible hidden
the element gets both classes "visible" and "hidden" above 700px, which is not what you want. Try the following instead: