-
Notifications
You must be signed in to change notification settings - Fork 185
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
Add Modern Font Stacks #498
base: main
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
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.
overall the PR looks great! i've got a couple open questions to consider:
- are these fonts better as an optional import rather than being part of the default bundle?
- is the typography documentation section overwhelming now with all the typography example blocks? we could consider using the
<details>
element OR make a switcher that lets people choose a font prop from a dropdown, which updates an example or all the typography examples - how can we give @danklammer and Modern Font Stacks more cred for the values?
i'll pose it to the group in discord and see how folks feel about it
thanks for this, i'm excited about it 🙂
--font-system-ui: system-ui, sans-serif; | ||
--font-transitional: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, serif; | ||
--font-old-style: 'Iowan Old Style', 'Palatino Linotype', 'URW Palladio L', P052, serif; | ||
--font-humanist: Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif; | ||
--font-geometric-humanist: Avenir, Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif; | ||
--font-classical-humanist: Optima, Candara, 'Noto Sans', source-sans-pro, sans-serif; | ||
--font-neo-grotesque: Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif; | ||
--font-monospace-slab-serif: 'Nimbus Mono PS', 'Courier New', monospace; | ||
--font-monospace-code: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace; | ||
--font-industrial: Bahnschrift, 'DIN Alternate', 'Franklin Gothic Medium', 'Nimbus Sans Narrow', sans-serif-condensed, sans-serif; | ||
--font-rounded-sans: ui-rounded, 'Hiragino Maru Gothic ProN', Quicksand, Comfortaa, Manjari, 'Arial Rounded MT', 'Arial Rounded MT Bold', Calibri, source-sans-pro, sans-serif; | ||
--font-slab-serif: Rockwell, 'Rockwell Nova', 'Roboto Slab', 'DejaVu Serif', 'Sitka Small', serif; | ||
--font-antique: Superclarendon, 'Bookman Old Style', 'URW Bookman', 'URW Bookman L', 'Georgia Pro', Georgia, serif; | ||
--font-didone: Didot, 'Bodoni MT', 'Noto Serif Display', 'URW Palladio L', P052, Sylfaen, serif; | ||
--font-handwritten: 'Segoe Print', 'Bradley Hand', Chilanka, TSCu_Comic, casual, cursive; | ||
--font-emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; |
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'm curious if these need the quotes around them or not?
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.
According to MDN, they're recommended but not required 🤷🏼♂️
"--font-weight-1": "100", | ||
"--font-weight-2": "200", | ||
"--font-weight-3": "300", | ||
"--font-weight-4": "400", | ||
"--font-weight-5": "500", | ||
"--font-weight-6": "600", | ||
"--font-weight-7": "700", | ||
"--font-weight-8": "800", | ||
"--font-weight-9": "900", | ||
|
||
'--font-lineheight-00': '.95', | ||
'--font-lineheight-0': '1.1', | ||
'--font-lineheight-1': '1.25', | ||
'--font-lineheight-2': '1.375', | ||
'--font-lineheight-3': '1.5', | ||
'--font-lineheight-4': '1.75', | ||
'--font-lineheight-5': '2', | ||
"--font-lineheight-00": ".95", | ||
"--font-lineheight-0": "1.1", | ||
"--font-lineheight-1": "1.25", | ||
"--font-lineheight-2": "1.375", | ||
"--font-lineheight-3": "1.5", | ||
"--font-lineheight-4": "1.75", | ||
"--font-lineheight-5": "2", |
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.
looks like a formatter changed all the quotes to it's preference and made it into the PR. can you trim these quote change commits from the PR please? 🙂
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.
Sorry I missed that 😅
Good point about giving them more credit. I think it would also be nice to have some information explaining why people would want to use these over an external font. Maybe that explanation and better credit could be in a paragraph after the "Font Families" heading? |
@@ -2114,6 +2114,22 @@ <h4>Font Families</h4> | |||
--font-sans: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; |
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.
Tangent scope: I don’t see the purpose in trying to override the user agent’s sans-serif
for these other ones. A lot of Linux machines come with Ubuntu or Roboto but that doesn’t mean that in is the font they set for their browsers fallback. Save some bytes & just skip it. Why not just ui-sans-serif, sans-serif
?
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 wrote a reply here, but after thinking about it, it's all legacy and designer preference. The point for me generally, is to give the user a font they're used to, not one we think looks better. That's what we load fonts and change headers for if we want, but not body copy.
I could def see a version of Open Props updated to shed that legacy preference noise.
Opened #500
@@ -2114,6 +2114,22 @@ <h4>Font Families</h4> | |||
--font-sans: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; | |||
--font-serif: ui-serif, serif; | |||
--font-mono: Dank Mono, Operator Mono, Inconsolata, Fira Mono, ui-monospace, SF Mono, Monaco, Droid Sans Mono, Source Code Pro, monospace; |
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.
Additionally, what is the point of this? Users can set the font in the user agent for monospace just as much. ui-monospace, monospace
is more appropriate than ignoring the user’s settings for this long stack that users might not want (personally for instance, I hate Fira Mono / Fira Code, & would be mad if that showed up before the font I have set in my browser, Berkeley Mono).
This seems way more opinionated than this project needs to be for defaults. If you do have an opinion, an override like --font-mono: var(--font-monospace-slab-serif)
makes more sense which I think fits better with the goals of this font-stack patch.
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 that these could be removed if modern font stacks are added.
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.
The fact that paid fonts are ahead of the stack & aren’t a part of operating system too feels like an unnecessary ad.
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.
let's remove it! I agree. if you include it in this PR, go ahead and indicate in the commit it fixes #500 👍🏻
@@ -2114,6 +2114,22 @@ <h4>Font Families</h4> | |||
--font-sans: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; | |||
--font-serif: ui-serif, serif; |
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.
This one gets it. :)
I've got finals this week and next week so I won't be able to do much here until after that |
hope finals went well! let us know if you need help closing this out. it's a sweet addition. |
They did (still waiting for some results though 😶)! Thanks! So sorry for the delay— life’s been coming at me and my ADHD has had me hyperfixating on another project (built with open-props) lol. I’ll get back to this pr soon! |
Let me know if there's anything else I need to do. I think it might be nice to have an explanation of the benefits of using these props over an external font, but I'm not sure where it would fit. Thanks!