Skip to content
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

Why primeflex responsive is inverted? #195 #197

Open
samuel-aka-viana opened this issue Dec 12, 2023 · 2 comments
Open

Why primeflex responsive is inverted? #195 #197

samuel-aka-viana opened this issue Dec 12, 2023 · 2 comments

Comments

@samuel-aka-viana
Copy link

samuel-aka-viana commented Dec 12, 2023

i have a exemple of code, """

abacatada 1
abacatada 2
abacatada 3
abacatada 4
abacatada 5
""" but when i try to use the responsive, the clausule md:align-content-start has preference in code, begin with center, not using start when as i declared align-content-center
@nharrer
Copy link

nharrer commented Mar 7, 2024

Yes, the same here. Maybe I am misunderstanding the documentation. Shouldn't sm:xxxx apply xxxx to small screens only? But it seems to be the opposite.

Example with primeflex 3.3.1:

<div class="flex flex-row sm:flex-column gap-2" style="background-color: red">
  <div>aaaa</div>
  <div>bbbb</div>
  <div>cccc</div>
</div>

I would expect to have a flex-direction of column for screens <= 576px. And a row layout otherwise. But it's just the other way around:

image
image
Example on Stackblitz: https://stackblitz.com/edit/angular-ivy-khexpu

@nharrer
Copy link

nharrer commented Mar 18, 2024

Please ignore my last comment. Coming from Angular Flex-Layout, that seemed to be the way it was supposed to work.

But in fact, it is a mobile-first breakpoint system. I only realized that after learning to use Tailwind and studying their documentation:

Where this approach surprises people most often is that to style something for mobile, you need to use the unprefixed version of a utility, not the sm: prefixed version. Don’t think of sm: as meaning “on small screens”, think of it as “at the small breakpoint“.

So sm: means at the breakpoint sm and above. It makes sense now, and everything is working as intended.

However, I have a little critique: The PrimeFlex documentation doesn't mention that at all. So for people some people with a different background, this can be a bit confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants