Skip to content

Commit

Permalink
Do not log failed rule insertions in the speedy mode for vendor-prefi…
Browse files Browse the repository at this point in the history
…xed pseudo-elements/classes (#2149)

Co-authored-by: Mitchell Hamilton <mitchell@hamil.town>
  • Loading branch information
Andarist and emmatown committed Dec 2, 2020
1 parent 97e5110 commit 5469d00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eleven-hairs-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/sheet': patch
---

Do not log failed rule insertions in the speedy mode for vendor-prefixed pseudo-elements/classes like `::-moz-placeholder`.
7 changes: 6 additions & 1 deletion packages/sheet/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@ export class StyleSheet {
// the big drawback is that the css won't be editable in devtools
sheet.insertRule(rule, sheet.cssRules.length)
} catch (e) {
if (process.env.NODE_ENV !== 'production') {
if (
process.env.NODE_ENV !== 'production' &&
!/:(-moz-placeholder|-ms-input-placeholder|-moz-read-write|-moz-read-only){/.test(
rule
)
) {
console.error(
`There was a problem inserting the following rule: "${rule}"`,
e
Expand Down

0 comments on commit 5469d00

Please sign in to comment.