How to work with tailwind classes? #3112
-
I'm trying to make a simple div with 2 column divs inside, first with 1/4 and the second with 3/4 width. I tried the flex basis syntax like this. This is literally the very basic example from tailwind doc https://tailwindcss.com/docs/flex-basis#setting-the-flex-basis: with ui.row().classes("flex flex-row"):
with ui.column().classes("basis-1/4"):
ui.label("1/4 col")
with ui.column().classes("basis-3/4"):
ui.label("3/4 col") But it doesn't work, the second column renders below the first one. I also tried w-1/4 in place of basis-1/4, tried adding w-full on the parent container, and few other things but none of this is working. Am I missing something? Do I need to initialize something or add some parent container, for those classes to work correctly? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @PawelRoman, You can add with ui.row(wrap=False).classes("flex flex-row"):
with ui.column().classes("basis-1/4 border"):
ui.label("1/4 col")
with ui.column().classes("basis-3/4 border"):
ui.label("3/4 col") The difference to a plain Tailwind example might come from |
Beta Was this translation helpful? Give feedback.
-
Actual answer requires w-full in addition to wrap=False. with ui.row(wrap=False).classes("flex flex-row w-full"):
with ui.column().classes("basis-1/4"):
ui.label("01")
with ui.column().classes("basis-3/4"):
ui.label("02") |
Beta Was this translation helpful? Give feedback.
Hi @PawelRoman,
You can add
wrap=False
to prevent theui.row
element from wrapping:The difference to a plain Tailwind example might come from
ui.row
's default layout, which uses Quasar's "row" class to create a flex layout. While CSS's flexboxes don't wrap by default, Quasar's "row" does. That's why we introduced thewrap
parameter.