dripsy
dripsy copied to clipboard
Heading (H1, H2, H3, ...) doesn't apply the custom fontWeight property
I use customFont
and try to change the default fontWeight
for each heading within the theme, but it is not applied.
This is an example with <H1>
and <Text variant="h1">
:
-
theme:
-
code:
-
app:
Only <Text>
has the correct fontWeight
Is this on Android?
Yes
Yeah it’s a known bug, it’s because expo/html-elements sets fontWeight when it shouldn’t. The solution would be to copy the expo components into Dripsy. I’d be happy to review a PR.
Here is another solution that is working for me. Setting the fontWeight to normal
in the style prop:
<H1 style={{fontWeight: "normal"}}>Title</H1>
~~Edit: this was when using a custom font., so maybe slightly unrelated from the OPs issue. I was using the fontWeight property in the theme to use a custom font and on Android it was not using that font unless I did this.~~
Edit2: Realized the original posts looks to be using multiple fonts and does set a custom font. I have verified that setting the style prop also works in this situation
I think I'm going to close this since it's an issue with @expo/html-elements
. Or maybe we apply that style under the hood as @levic92 mentioned.