cssinjs/jss

Including two @font-face blocks in addRules throws error

Open

#908 建立於 2018年10月28日

在 GitHub 查看
 (12 留言) (1 反應) (0 負責人)JavaScript (7,000 star) (434 fork)batch import
bugcomplexity:lowhelp wantedimportant

描述

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

貢獻者指南