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

How can I make the Stat to be responsive / vertical for small devices? #1236

Closed
Mashiane opened this issue Oct 12, 2022 · 5 comments
Closed

Comments

@Mashiane
Copy link
Contributor

Hi there

I cant seem to make the Stat reponsive. Here is the tailwind play... Im trying to make it vertical for small devices

https://play.tailwindcss.com/0QWV1BN9Gb?size=470x720

stat

Thanks in advance

@daveteu
Copy link

daveteu commented Oct 12, 2022

<div class="stats stats-vertical sm:stats-horizontal shadow">
https://play.tailwindcss.com/GCrd1SzxXc?size=540x720

@Mashiane
Copy link
Contributor Author

Thank you so much, me was thinking the classes and their responsive counterparts are mutually exclusive.

@Mashiane
Copy link
Contributor Author

Mashiane commented Oct 13, 2022

Sorry, please bear with me, just to confirm, your solution works, but shouldnt this be the other way round? Can you please clarify?
Horizontal is from left to right whilst vertical is top to bottom or vice versa.

image

So stats-vertical means top to bottom (my request) whilst sm:stats-horizontal means left to right (the opposite)

image

Shouldnt the classes be stats-horizontal (left to right for anything else) and then sm:stats-vertical (top to bottom) for small devices)? Confusing...

@Mashiane
Copy link
Contributor Author

Anyway I just noted this, #807 and am realizing what my problem is, I guess I have to wait for the next update. Thanks you.

@saadeghi
Copy link
Owner

Shouldnt the classes be stats-horizontal (left to right for anything else) and then sm:stats-vertical (top to bottom) for small devices)? Confusing...

sm: prefix on Tailwind CSS means "screens larger than sm (640px)"
So, in <div class="stats stats-vertical sm:stats-horizontal"> it means:

  • it's vertical by default
  • it will be horizontal on screens larger than 640px

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

3 participants