cssinjs/jss

Including two @font-face blocks in addRules throws error

Open

#908 geöffnet am 28. Okt. 2018

Auf GitHub ansehen
 (12 Kommentare) (1 Reaktion) (0 zugewiesene Personen)JavaScript (434 Forks)batch import
bugcomplexity:lowhelp wantedimportant

Repository-Metriken

Stars
 (7.000 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Expected behavior: I would expect an output of two @font-face rules added to the stylesheet.

Describe the bug: Having one @font-face rule in an addRules object outputs and injects the correct CSS. Adding a second @font-face rule throws this error:

Warning: [JSS] Can not insert an unsupported rule 

@font-face {
  font-family: "Font One";
  src: url("/fonts/font-one.woff");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "Font Two";
  src: url("/fonts/font-two.woff");
  font-weight: normal;
  font-style: normal;
}

Codesandbox link: https://codesandbox.io/s/n5xn8y0vwl?expanddevtools=1

Versions (please complete the following information):

  • jss: 9.8.7
  • Browser: Chrome 69.0.3497.100
  • OS: Mac 10.14

Contributor Guide