threepointone / glamor

inline css for react et al
MIT License
3.66k stars 199 forks source link

Font Face Multiple Font Support #366

Open adamsoffer opened 6 years ago

adamsoffer commented 6 years ago

Is it possible to include multiple fonts using font-face? Here's how I declare my font using font-face:

import { css } from 'glamor'

css.global('@font-face', {
  fontFamily: 'Univers',
  fontStyle: 'italic',
  fontWeight: '200',
  src: `url('...'),
})

Seems I can only include one font.

elliotdickison commented 6 years ago

I believe that's just how @font-face works, you get one font per declaration (although you can specify multiple sources if you have various file formats). You can always just call css.global multiple times to add multiple @font-face declarations. I've done that in the past and had no problem.