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

[Docs] Updating Text page and Sass guidelines and upgrading to variable font #5078

Merged
merged 15 commits into from
Sep 8, 2021

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Aug 24, 2021

Closes #3964 as this PR confirms that font-feature settings are working and we're serving the full variable font in our docs (in Amsterdam).

Utility addition

Added .eui-textNumber utility class

We already had euiNumberFormat as a utility mixin, so I created a quick utility class as well. I named the class though more aligned to our other utility classes instead of the mixin name that already existed.

Screen Shot 2021-08-31 at 09 49 28 AM

Docs

Replaced Text Sizing example with the contents from Text Scaling

These were doing essentially the same thing (comparing two sizes of EuiText blocks). But the tab was called "Guidelines", which is incorrect for what it was demonstrating. So I've just put that contents (showing the baseline grid) into the text sizing and made it adjustable so you can compare ANY two sizes.

image

The somewhat irony is that the line-heights don't always actually line up on the baseline grid because of the way browsers handle rounding of decimals.

Refactored Sass guidelines page and updated the font-weight section for variable fonts (Amsterdam)

This is the main reason this PR touched a lot of files.
This file had a lot going on and was hard to manage when I was updating it, so I broke it apart into respective files per section. I also moved the "Writing Sass Guidelines" section to the top instead of the bottom because I think this is what most consumers get wrong/don't see.

This also enabled the subsections to finally show up in the side nav. And wherever we were indicating how to import or link references to actual files, I made sure we were pointing to the right one/way for the current theme selected.

image

I also updated the Typography section to showcase the font-weight options and how to import the fonts based on the current theme selection. Which also meant changing the import for docs to use the spread notation to get all the in-between font weights.

Screen Shot 2021-08-31 at 10 13 30 AM

Network check

I did a quick check about how this affected the size of the font file that was being fetched and it looks like there was very minimal change. In fact, the main increase is because of the update to include the oblique (-10 slant) (italic) version which wasn't included before. Especially when compared to the overall bundle size.

image

Updated "Getting Started" with more guidance on importing fonts

This section I updated with portions about variable fonts and local fonts.
Screen Shot 2021-08-31 at 10 13 03 AM

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox

- [ ] Props have proper autodocs and playground toggles

- [ ] Added or updated jest tests
- [ ] Checked for breaking changes and labeled appropriately

  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5078/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5078/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5078/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5078/

@cchaos cchaos changed the title [Docs] Updating Text section and upgrading to variable font [Docs] Updating Text page and Sass guidelines and upgrading to variable font Aug 30, 2021
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5078/

@cchaos cchaos marked this pull request as ready for review August 31, 2021 15:03
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5078/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5078/

@cchaos cchaos requested a review from miukimiu September 8, 2021 13:35
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5078/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5078/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

Updated page looks great!
Code changes LGTM

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@miukimiu miukimiu left a comment

Choose a reason for hiding this comment

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

The refactored pages look great. I love the small details like the font-weight range slider. 😍

I looked at the changed files and tested the changes in Chrome, Safari, Edge, and Firefox.

LGTM! 🎉

@cchaos cchaos enabled auto-merge (squash) September 8, 2021 17:06
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5078/

@cchaos cchaos merged commit 1e0fd8a into elastic:master Sep 8, 2021
@cchaos cchaos deleted the docs/display_1 branch September 8, 2021 17:39
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.

Font features not working with Inter served by Google Fonts
4 participants