-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Typography] Add a custom, self-hosted font demo #14928
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into it.
Yes, that's pretty much what I said yesterday in chat. The only reference to fonts in the survey is WRT using @mdi/font with It perhaps got mistranslated to "Theme: Non-material font example", which got misinterpreted as "self hosted font demo", and here we are. |
Well, at the very least this PR, merged or closed, can serve as documentation for any future users 😆 |
Add a custom, self-hosted font typography demo.
…atted. Remove unnecesary imports from self-hosted font demo.
Update font family theme customization docs to include information on using fonts via overrides.
6909a8a
to
2339201
Compare
No bundle size changes comparing 10438a1...52d155d |
@@ -216,13 +216,62 @@ If you want to learn more about typography, you can check out [the typography se | |||
|
|||
{{"demo": "pages/customization/themes/TypographyTheme.js"}} | |||
|
|||
#### Typography - Font family | |||
### Typography - Font family |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe we repeat the heading from the level above like this elsewhere in the docs. Would this be a good opportunity remove it, or is the extra clarity needed here for some reason? cc: @oliviertassinari
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnrichter what do you think? Do you want to change the headers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Certainly. One moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to go 👍
@johnrichter That turned out to be a worthwhile exercise, despite the initial misunderstanding. Thanks for working on it! 👍 |
You're welcome. I'm glad I could help! I want to find more time to contribute so you'll probably see more PRs from me in the future. I've been going from zero to hero using MUI solely in TS and could probably submit some fixes or quality of life changes as I run into them. |
That would be great! PRs that make getting started easier are always welcome. If they're small things, you could always keep a note of them and batch them. |
@johnrichter It's a great first pull request on Material-UI 👌🏻. Thank you for working on it! |
I read the results of the Material UI survey this weekend and saw that a custom typography demo was asked for. Since I had recently added Roboto as a self-hosted font to my web app I figured I'd pull that out and make a demo of it using Raleway instead.
Since I wanted to reuse the main Typography demo, I converted it to Typescript and Hooks.
yarn typescript
passesyarn docs:typescript:formatted
passesyarn prettier
was run, but produced some odd formatting (extreme amounts of indenting) so I manually corrected that after running it.yarn lint
TBD. Has issue loading font files. See both errors below.I am having trouble building the documentation website to see if the demo works properly because there isn't a babel plugin or loader configured to load
.woff2
or.ttf
files. Would love some guidance as I normally lean on CRA heavily and don't know my way around Babel or its plugins.Docs Page:
http://127.0.0.1:3000/style/typography
I could just switch this to use Google's CDN as I mention in the code comments and then write a detailed comment in the block at the top on how you'd self-host. I'm open to w/e is easier or better for everyone.
I'm also not sure if you'd like to use LFS for the binary font files, but that could easily be done as well.