Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add Modern Font Stacks #498

wants to merge 2 commits into from

Conversation

Jothsa
Copy link
Contributor

@Jothsa Jothsa commented May 1, 2024

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!

Copy link

stackblitz bot commented May 1, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@argyleink
Copy link
Owner

Look at all that tucked into nice little props 👍🏻
I do wonder if we need to break these modern font stacks into their own import?

Screenshot 2024-05-02 at 2 31 26 PM

Screenshot 2024-05-02 at 2 32 01 PM
Screenshot 2024-05-02 at 2 32 08 PM

wonder if we should put ^ these behind a summary details so they don't take up so much space? was cool when there were a few, but now there's a lot.

Copy link
Owner

@argyleink argyleink left a 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:

  1. are these fonts better as an optional import rather than being part of the default bundle?
  2. 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
  3. 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 🙂

Comment on lines +2117 to +2132
--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';
Copy link
Owner

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?

Copy link
Contributor Author

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 🤷🏼‍♂️

docsite/index.html Show resolved Hide resolved
src/props.fonts.css Show resolved Hide resolved
Comment on lines +36 to +52
"--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",
Copy link
Owner

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? 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed that 😅

@Jothsa
Copy link
Contributor Author

Jothsa commented May 3, 2024

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;
Copy link

@toastal toastal May 8, 2024

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?

Copy link
Owner

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;
Copy link

@toastal toastal May 8, 2024

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.

Copy link
Contributor Author

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.

Copy link

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.

Copy link
Owner

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;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one gets it. :)

@Jothsa
Copy link
Contributor Author

Jothsa commented May 8, 2024

I've got finals this week and next week so I won't be able to do much here until after that

@argyleink
Copy link
Owner

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.

@Jothsa
Copy link
Contributor Author

Jothsa commented Jun 4, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants