-
-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quasar CSS flexbox layout classes don't work #2881
Comments
Thanks, @me21! I'm not sure if this is a bug in But I understand the confusion. If Do you have an idea what to do about it? Should we simply add the "row" class on every |
I see that |
You're right, I was trying to say we're not adding Quasar or Tailwind classes, but only our own "nicegui-*" classes that are referenced in nicegui.css to add some default styling. I think our reasoning was as follows:
Here are two related posts: |
Well, .nicegui-row style is: {
display: flex;
flex-direction: row;
align-items: flex-start;
gap: var(--nicegui-default-gap);
padding: var(--nicegui-default-padding);
} And .row style is: {
display: flex;
flex-wrap: wrap;
} Seems short enough, doesn't add extra styles that would be hard to override from user code. So it's fairly safe to add "row" class to But the core rule in quasar.prod.css that makes "col-6" and alike work, is: .row > .col-6, .row > .col-xs-6 {
height: auto;
width: 50%;
} If you'd rather not add Quasar classes to elements, what do you think about repeating this rule for "nicegui-row" class, like: .nicegui-row > .col-6, .nicegui-row > .col-xs-6 {
height: auto;
width: 50%;
} Why Tailwind classes have higher specificity than NiceGUI ones? |
Yes, Repeating
I must correct myself once again: Both seem to have the same specificity, but Tailwind CSS is defined after loading nicegui.css and therefore takes precedence over nicegui.css. |
I agree with your evaluation. Adding back "row" and "column" classes to respective elements and changing |
Another option would be stating this in the documentation explicitly and not changing anything. |
Description
Consider the following code:
The labels don't take 50% of the parent element width. But if we write the enclosing row as
with ui.row().classes('w-full gap-0 row'):
, addingrow
class, the layout looks as expected.According to https://quasar.dev/layout/grid/introduction-to-flexbox#setting-direction, it's mandatory to have one of a few classes on the parent for the children classes to work.
A workaround is to use TailwindCSS classes (
w-1/2
instead ofcol-6
) on children.The text was updated successfully, but these errors were encountered: