-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Support custom fonts in ThemeProvider (#216)
- Loading branch information
1 parent
17575b1
commit f80adf4
Showing
3 changed files
with
51 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ThemeProvider } from '@lobehub/ui'; | ||
import { useTheme } from 'antd-style'; | ||
import { Flexbox } from 'react-layout-kit'; | ||
|
||
export default () => { | ||
const theme = useTheme(); | ||
return ( | ||
<Flexbox> | ||
<ThemeProvider> | ||
<p>Default Fonts</p> | ||
<h1>Hello World</h1> | ||
</ThemeProvider> | ||
<ThemeProvider | ||
customFonts={[ | ||
'https://registry.npmmirror.com/@lobehub/webfont-mono/latest/files/css/index.css', | ||
]} | ||
theme={{ | ||
token: { | ||
fontFamily: `Hack, ${theme.fontFamily}`, | ||
}, | ||
}} | ||
> | ||
<p>Custom Fonts</p> | ||
<h1>Hello World</h1> | ||
</ThemeProvider> | ||
</Flexbox> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters