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

Recommended way to change fonts #56

Closed
ecommerce-technician opened this issue Sep 5, 2020 · 2 comments
Closed

Recommended way to change fonts #56

ecommerce-technician opened this issue Sep 5, 2020 · 2 comments
Labels
complexity: low package: theme NPM package @arwes/theme type: docs Guides, tutorials, API docs, code docs.

Comments

@ecommerce-technician
Copy link

Fonts are non-standard to change

I want to use. a custom local font. When I bring it in as a font-face in CSS it isnt working

Your environment

  • Mac Catalina
  • Chrome 85
  • Node 14.9, npm 6.14

Steps to reproduce

Look for documentation about replacing a font

Fail in finding said documentation

Create a fonts/ >> Your Font << / >> Your Font >> .otf

in index.css

@font-face {
  font-family: 'SigmaFive';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/sigma_five/SigmaFive.otf'),
  format('opentype')
}

Expected behavior

The font shows up

Actual behavior

The font does not show up

@romelperez romelperez added complexity: low package: theme NPM package @arwes/theme type: docs Guides, tutorials, API docs, code docs. labels Sep 5, 2020
@romelperez
Copy link
Member

Hi @ecommerce-technician !

You can setup the theme typography by passing the following theme props: https://github.com/arwes/arwes/blob/version1-breakpoint1/src/tools/createTheme/theme.js#L67-L68 like this:

const myTheme = {
  typography: {
    headerFontFamily: '"Electrolize", "sans-serif"',
    fontFamily: '"Titillium Web", "sans-serif"'
  }
};

const App = () => (
  <ThemeProvider theme={createTheme(myTheme)}>
    ...
  </ThemeProvider>
);

You can set the font families as if they are coming from a CDN like Google Fonts or locally installed.

@ecommerce-technician
Copy link
Author

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: low package: theme NPM package @arwes/theme type: docs Guides, tutorials, API docs, code docs.
Projects
None yet
Development

No branches or pull requests

2 participants