why does tailwind use rem instead of em?
Basically the title. This is mostly just out of curiosity but im trying to make my existing webapp (that was written for desktop) mobile friendly and it seems like its going to be a lot of work to add
className="text-lg :lg:text-xl xl:text-3xl"
all over my code20 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
It's better to generally not use em, and use rem instead because sometimes it might cause undesired behaviour. That's why either bootstrap and tailwind uses it and it's generally recommended to use it.
ok. ive seem some conflicting stuff online
somethings say you can just use em and font sizes are kinda responsive without much work
but it was definitely confusing
is there a source somewhere on why its bad practice?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
that makes a lot of sense
is the book worth it? i was considering getting it
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
ok. thanks. that quote alone clears up a lot
thanks
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yes absolutely. Highly recommended.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
clamp
is good if you are going for just css. If you are using Tailwind if you have repeating same text sizes for each h1 up to h6 you can use @apply
that seems good. kinda not how tailwind works... this is my first project with tailwind. it makes a lot of stuff so much faster to write and think about, but it definitely seems limitting too
@SuplenC oh ok. ill have to look into that
there is a good video from fireship that shows most of the tailwind features: https://www.youtube.com/watch?v=pfaSUYaSgRo
Fireship
YouTube
Ultimate Tailwind CSS Tutorial // Build a Discord-inspired Animated...
Learn the basics of Tailwind CSS by building a Discord-inspired navbar from scratch. Learn how to leverage utility classes to build responsive animated UI elements faster https://fireship.io/lessons/tailwind-tutorial/
#webdev #css #tutorial
🔗 Resources
Tailwind Docs https://tailwindcss.com/
Tailwind React Setup https://tailwindcss.com/docs/gu...
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
thats true too
true but not the nicest solution. The config one is the best at that point
i like the idea of having a file with all my common font sizes on all the screen sizes though and then just using
text-h1
all possible with either in config or
@apply
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
got it
ty guys a lot