Skip to content

Commit d282597

Browse files
authored
Use global styles (#7659)
Alternate solution to #7554
1 parent c087805 commit d282597

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.changeset/wise-rockets-pump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'polaris.shopify.com': patch
3+
---
4+
5+
Added global styles from deps instead of linking unpkg

polaris.shopify.com/pages/_app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Script from 'next/script';
44
import {useEffect} from 'react';
55
import {useRouter} from 'next/router';
66
import useDarkMode from 'use-dark-mode';
7+
import '@shopify/polaris/build/esm/styles.css';
78

89
import {className} from '../src/utils/various';
910
import Frame from '../src/components/Frame';

polaris.shopify.com/src/components/PolarisExampleWrapper/PolarisExampleWrapper.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ import translations from '@shopify/polaris/locales/en.json';
33
import {ComponentType} from 'react';
44
import styles from './PolarisExampleWrapper.module.scss';
55

6-
const stylesheetHref =
7-
'https://unpkg.com/@shopify/polaris@latest/build/esm/styles.css';
8-
96
export const withPolarisExample = (Component: ComponentType) => {
107
const PolarisHOC = (props: any) => {
118
return (
129
<>
13-
<link rel="stylesheet" href={stylesheetHref} />
1410
<AppProvider i18n={translations}>
1511
<div className={styles.Container}>
1612
<div id="polaris-example" className={styles.Example}>

0 commit comments

Comments
 (0)