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

[Inter] Remove temp fix for font-optical-sizing issue in Safari 16 #12737

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/angry-clouds-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Removed workaround for `font-optical-sizing` issue in Safari 16
19 changes: 0 additions & 19 deletions polaris-react/src/components/AppProvider/AppProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,6 @@ export class AppProvider extends Component<AppProviderProps, State> {
this.stickyManager.setContainer(document);
this.setBodyStyles();
this.setRootAttributes();

const isSafari16 =
navigator.userAgent.includes('Safari') &&
!navigator.userAgent.includes('Chrome') &&
(navigator.userAgent.includes('Version/16.1') ||
navigator.userAgent.includes('Version/16.2') ||
navigator.userAgent.includes('Version/16.3'));

const isMobileApp16 =
navigator.userAgent.includes('Shopify Mobile/iOS') &&
(navigator.userAgent.includes('OS 16_1') ||
navigator.userAgent.includes('OS 16_2') ||
navigator.userAgent.includes('OS 16_3'));

if (isSafari16 || isMobileApp16) {
document.documentElement.classList.add(
'Polaris-Safari-16-Font-Optical-Sizing-Patch',
);
}
}
measureScrollbars();
}
Expand Down
5 changes: 0 additions & 5 deletions polaris-react/src/components/AppProvider/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,3 @@ button::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
border-style: none;
}

html[class~='Polaris-Safari-16-Font-Optical-Sizing-Patch'] {
/* Inter's "opsz" axis ranges from 14 to 32. This patch optimizes for smaller and less legible text by setting "opsz" 14 for all font sizes. */
font-variation-settings: 'opsz' 14;
}
Loading