Replies: 4 comments 4 replies
-
I just realized that while my font sizes are working correctly, my |
Beta Was this translation helpful? Give feedback.
-
As I work through it, I realize there's probably no reason for me to keep using 62.5%. With Sass it was nice because anytime I wanted to set a font-size, it was easy to know that 1rem = 10px. But with Tailwind I'd only need to set up everything once up-front, and never worry about it again. |
Beta Was this translation helpful? Give feedback.
-
Browsers treat rem units in media queries unintuitively I’m afraid, they always use the browser default font size not your root font size declared in your HTML element. The only unit that works in a perfectly predictable way with media queries is pixels. |
Beta Was this translation helpful? Give feedback.
-
I have overridden the base font-size value with 62.5% and its working fine but as all width, padding, margin and spacing are calculating the values depending on the base font size all are gone smaller. Is there any way to use font-size and may be line-height in accordance to modified 62.5%(10px) value but not to touch any other part of the css. We can fix those by extending but it seems that would be a huge task to do. |
Beta Was this translation helpful? Give feedback.
-
I'm wondering if there are any potential issues in me setting my html font-size to 62.5% and then adjusting all rem values accordingly within the Tailwind config file. Is there anything I could break by doing this?
Note: I set font-size to 62.5% so that 1rem = 10px, making it easier to know that 1.5rem = 15px, 2.3rem = 23px, etc...
Here is what I've done:
And then in the config file:
Beta Was this translation helpful? Give feedback.
All reactions