Including two @font-face blocks in addRules throws error
See original GitHub issueExpected behavior: I would expect an output of two @<span>font-face</span> rules added to the stylesheet.
Describe the bug:
Having one @<span>font-face</span> rule in an addRules
object outputs and injects the correct CSS. Adding a second @<span>font-face</span> 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
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Error with multiple font-face declarations - css - Stack Overflow
The problem is that with this code not only this section, but the whole page is transforming to font-weight:light and I have no...
Read more >Add Rules to Stylesheets with JavaScript - David Walsh Blog
Use JavaScript to add rules to CSS stylesheets programmatically with addRule ... Media query-specific rules can be added in one of two ways....
Read more >font-face - CSS: Cascading Style Sheets - MDN Web Docs
Chrome Edge
@font‑face Full support. Chrome1. Toggle history Full support...
OpenType CBDT and CBLC rendering Full support. Chrome66. Toggle history Full support...
OpenType COLRv0 rendering Full...
Read more >CSS Object Model (CSSOM) - W3C
CSSOM defines APIs (including generic parsing and serialization rules) for ... If nothing was removed, then throw a NotFoundError exception.
Read more >CSS - Test Your CSS Skills Number 35 - inline-block - HTML & CSS ...
count me out for the second part. but i do want to read about it ... didn't expect it to be so simple...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any progress on this?
I am not working on it, so if you like to fix it please send a PR and a test