Replies: 1 comment 2 replies
-
You can override them by just using React's composition. Create a Text component that uses ours under the hood import { Text as BaseText } from '@react-email/text';
function Text(props) {
return <BaseText {...props} style={{ 'font-size': '16px', ...props.style }} />;
} I'm not sure why we do have |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
Background
The default font size of the web is 16px.
But the fontsize of is set to 14px. But s are still 16px.
So by default, emails will look funky with inconsistent font sizes. So okay, I'll just go update s to be size 14px, using Tailwind, as that seems to be the preferred method of styling. I give a a class of text-sm, but this is 0.875rem, not 14px. Which means that email looks fine on gmail where root font size is 16px, but awful (inconsistent sizing) on Apple Mail, where the root font size is smaller.
In summary, because react-email's styling library of choice is Tailwind, which works in rem, then styling naturally leads to pit of failure if you will, where you get inconsistent font-sizes across different email clients.
Proposal
I would like a method to override the default font size of elements, maybe via react-email config, or via Tailwind config, as described in this related issue: #517
Beta Was this translation helpful? Give feedback.
All reactions