How add custom font family?
See original GitHub issueI installed a font using expo in this way. It works
<Text style={{ fontFamily: 'Inter_900Black' }}>Inter Black</Text>
Now I updated tailwind.config.js
in this way:
module.exports = {
content: [
"./**/*.{ts,tsx}",
],
theme: {
extend: {
fontFamily: {
'inter-black': ['Inter_900Black'],
},
},
},
plugins: [],
corePlugins: require('tailwind-rn/unsupported-core-plugins'),
}
So I updated the style. But I’m getting the error: Unsupported Tailwind class: "inter-black"
<Text style={tailwind('inter-black') }>
Inter Black
</Text>
Also, I tried in this way, but same message:
module.exports = {
content: [
"./**/*.{ts,tsx}",
],
theme: {
fontFamily: {
'inter-light': ['Inter_300Light'],
'inter-black': ['Inter_900Black'],
},
extend: {},
},
plugins: [],
corePlugins: require('tailwind-rn/unsupported-core-plugins'),
}
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
How To Load and Use Custom Fonts with CSS | DigitalOcean
The most performant way to customize fonts is to use fonts already ... In the body selector, add a font-family property, and make...
Read more >The Easy Way to Add Fonts to Your Website (Including ...
How to add custom fonts to your website using @font-face · Step 1: Download the font · Step 2: Create a WebFont Kit...
Read more >Using custom fonts using CSS? - Stack Overflow
Generically, you can use a custom font using @font-face in your CSS. Here's a very basic example: @font-face { font-family: 'YourFontName'; ...
Read more >CSS @font-face Rule - W3Schools
In the @font-face rule you must first define a name for the font (e.g. myFirstFont), and then point to the font file. To...
Read more >Use a custom font - Flutter documentation
You have two options for how to apply fonts to text: as the default font or only within specific widgets. To use a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Spent more time than I care to admit on this, but it turns out we’re just forgetting to prefix
font-
, eg.,font-inter-light
. Which, to be fair, could be more explicitly called out in the tailwind css docs.Works fine in tailwind-rn 4.2.0, works with or without theme extension.
@tommoholmes can you share a code snippet where you’re actually using the font?