Skip to content

Commit

Permalink
feat(globalstyles): reduce load times by using Arial instead of Monts…
Browse files Browse the repository at this point in the history
…errat

Previously, Montserrat was used on every foundry-ui component by default. It could be overwritten by
another using our globalStyles api, but the font would still be loaded by Google Fonts. This change
removes Montserrat and its loading in favor of an OS-default font: Arial. It also looks better and
Headstorm doesn't use Montserrat anymore anyway.

complete #250
  • Loading branch information
aVileBroker committed Jul 21, 2021
1 parent 62b1f00 commit 9e7ffff
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .storybook/headstormTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default create({
appBorderRadius: 4,

// Typography
fontBase: '"Montserrat", "Open Sans", sans-serif',
fontBase: '"Arial", "Open Sans", sans-serif',
fontCode: 'monospace',

// Text colors
Expand Down
6 changes: 3 additions & 3 deletions src/components/Examples/GlobalStyles.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const StyledCardContainer = styled(Card.Container)`
margin-bottom: 1rem;
`;
const fontFamilyOptions = {
Montserrat: 'Montserrat,Roboto,sans-serif',
Arial: 'Arial,Roboto,sans-serif',
'Times New Roman': '"Times New Roman",Times,serif',
Monospace: '"Lucida Console",Courier,monospace',
unset: 'unset',
Expand All @@ -25,8 +25,8 @@ const fontFamilyOptions = {
storiesOf('Global styles', module).add('Example', () => {
const fontFamily = select(
'font-family',
['Montserrat', 'Times New Roman', 'Monospace', 'unset'],
'Montserrat',
['Arial', 'Times New Roman', 'Monospace', 'unset'],
'Arial',
);
const primary = color('primary', colorsEnum.primary);
const grayDark = color('grayDark', colorsEnum.grayDark);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`RangeSlider renders 1`] = `
position: relative;
height: 1rem;
width: 100%;
font-family: Montserrat,Roboto,sans-serif;
font-family: Arial,Roboto,sans-serif;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down Expand Up @@ -92,7 +92,7 @@ exports[`RangeSlider renders 2`] = `
position: relative;
height: 1rem;
width: 100%;
font-family: Montserrat,Roboto,sans-serif;
font-family: Arial,Roboto,sans-serif;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
Expand Down
1 change: 0 additions & 1 deletion src/context/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export const defaultGlobalStyles = `
? ''
: `
box-sizing: border-box;
${fonts.importFonts}
${fonts.body}
`
}
Expand Down
3 changes: 1 addition & 2 deletions src/enums/fonts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
enum fonts {
importFonts = "@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;500;700;900&display=swap');",
body = 'font-family: Montserrat, Roboto, sans-serif;',
body = 'font-family: Arial, Roboto, sans-serif;',
}

export default fonts;

0 comments on commit 9e7ffff

Please sign in to comment.