Out of order custom font family names
See original GitHub issueWindiCSS version:
- “windicss”: “^3.1.3”
- “vite-plugin-windicss”: “^1.0.4”
I have implemented a custom font as follows:
index.html
:
<head>
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
</head
windi.config.ts
:
import defaultTheme from 'windicss/defaultTheme'
export default {
theme: {
extend: {
fontFamily: {
sans: ['"Inter var"', ...defaultTheme.fontFamily.sans],
},
},
},
attributify: true,
}
App.css
:
html {
@apply font-sans;
}
Unfortunately, the browser doesn’t pick up the custom font, ‘Inter var’. Upon inspecting the loaded App.css
file via the network tab, I can see the Inter var
font was inserted successfully but at the wrong location. See partial output:
...
const css = "html {\n font-family: ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\",\"Inter var\",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";\n}"
...
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
font-family - CSS: Cascading Style Sheets - MDN Web Docs
The font-family CSS property specifies a prioritized list of one or more font family names and/or generic family names for the selected ...
Read more >How To Load and Use Custom Fonts with CSS | DigitalOcean
In this tutorial, you will try out examples of loading fonts onto your website. You will use the font stack, a rank ordering...
Read more >How do I get the font name from an otf or ttf file? - Stack Overflow
In the debug output, look for your new font's 'family' and 'font' name. Pass whatever is displayed as the 'font' name corresponding to...
Read more >CSS Font Family List - TutorialBrain
SANS-SERIF FONT FAMILY ; Arial. Arial. Arial Black. Arial narrow. Arial Rounded MT Bold ; Helvetica. Helvetica ; Verdana. Verdana ; Calibri. Calibri....
Read more >Adding a Custom Font to Your App - Apple Developer
Use Your Custom Font in Source Code · for family in UIFont.familyNames.sorted() { · let names = UIFont.fontNames(forFamilyName: family) · print("Family: \(family) ...
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
Looks like it’s a bug. Before the fix, if you want to use
extend
here is a workaround:Thank you @HerrBertling !!