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

[polaris.shopify.com] Inter needs to be loaded as a variable weight font #10894

Closed
tjonx opened this issue Oct 5, 2023 · 1 comment · Fixed by #10895
Closed

[polaris.shopify.com] Inter needs to be loaded as a variable weight font #10894

tjonx opened this issue Oct 5, 2023 · 1 comment · Fixed by #10895
Assignees

Comments

@tjonx
Copy link
Contributor

tjonx commented Oct 5, 2023

Issue summary / Current behavior

On staging, regular and semibold fonts are bolder than they should be. This looks like the font we load (Inter) is being loaded per weight and not as a variable weight font.
<style data-href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap">

Our Regular font weight was changed from 400 to 450, but it gets rounded up to 500 because we're not loading the variable weight version of Inter.

Screen.Recording.2023-10-05.at.10.18.21.AM.mov

Same thing happens (less noticeably because it's used less) with Semibold, which went from 600 to 650, but is getting rounded up to 700.

Expected behavior

The font needs to be loaded as a variable weight font:

<style data-href="https://fonts.googleapis.com/css2?family=Inter:wght@400..700&amp;display=swap">

or load the new weights for regular and semibold instead:
<style data-href="https://fonts.googleapis.com/css2?family=Inter:wght@450;500;650;700&amp;display=swap">

@tjonx tjonx added the untriaged label Oct 5, 2023
@tjonx tjonx linked a pull request Oct 5, 2023 that will close this issue
5 tasks
@tjonx tjonx self-assigned this Oct 5, 2023
@tjonx tjonx added #gsd:36550 and removed untriaged labels Oct 5, 2023
tjonx added a commit that referenced this issue Oct 5, 2023
<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

Fixes #10894


<!--
  Context about the problem that’s being addressed.
-->

### WHAT is this pull request doing?

Load the correct font weights for regular ~`400`~ `450` and semibold
~`600`~ `650` tokens.

Updates migration guide and any other documentation (like the readme)
where the Inter font load string is present to include the correct
weights, and removes unnecessary weights (`100`, `200`, `300` and `800`,
`900`)

Before:

![image](https://github.com/Shopify/polaris/assets/67433661/9755c831-1a1b-4ca0-883b-c225ef4f1161)


After:

![image](https://github.com/Shopify/polaris/assets/67433661/045edf8b-cdbe-4c6c-97f7-f47b6182c705)


### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
@tjonx tjonx closed this as completed Oct 5, 2023
mrcthms pushed a commit that referenced this issue Oct 12, 2023
<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

Fixes #10894


<!--
  Context about the problem that’s being addressed.
-->

### WHAT is this pull request doing?

Load the correct font weights for regular ~`400`~ `450` and semibold
~`600`~ `650` tokens.

Updates migration guide and any other documentation (like the readme)
where the Inter font load string is present to include the correct
weights, and removes unnecessary weights (`100`, `200`, `300` and `800`,
`900`)

Before:

![image](https://github.com/Shopify/polaris/assets/67433661/9755c831-1a1b-4ca0-883b-c225ef4f1161)


After:

![image](https://github.com/Shopify/polaris/assets/67433661/045edf8b-cdbe-4c6c-97f7-f47b6182c705)


### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
mrcthms pushed a commit that referenced this issue Oct 12, 2023
<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

Fixes #10894


<!--
  Context about the problem that’s being addressed.
-->

### WHAT is this pull request doing?

Load the correct font weights for regular ~`400`~ `450` and semibold
~`600`~ `650` tokens.

Updates migration guide and any other documentation (like the readme)
where the Inter font load string is present to include the correct
weights, and removes unnecessary weights (`100`, `200`, `300` and `800`,
`900`)

Before:

![image](https://github.com/Shopify/polaris/assets/67433661/9755c831-1a1b-4ca0-883b-c225ef4f1161)


After:

![image](https://github.com/Shopify/polaris/assets/67433661/045edf8b-cdbe-4c6c-97f7-f47b6182c705)


### 🎩 checklist

- [ ] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
@bakura10
Copy link

Hi!

I am not sure if the root cause is Polaris or Chrome, but on Chrome Canary, I am experiencing a much bolder style for buttons, headings...

Chrome stable:

image

Chrome canary:

image

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 a pull request may close this issue.

2 participants