From 1318ca811acad61d0743098f6f993df574b7ff16 Mon Sep 17 00:00:00 2001 From: Silas Lenz Date: Wed, 17 Jan 2024 09:28:55 +0100 Subject: [PATCH 1/2] Add -webkit-scrollbar pseudo-elements to ignored prefixes --- .changeset/lovely-drinks-sort.md | 5 +++++ packages/sheet/src/index.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/lovely-drinks-sort.md diff --git a/.changeset/lovely-drinks-sort.md b/.changeset/lovely-drinks-sort.md new file mode 100644 index 000000000..6b52ed63c --- /dev/null +++ b/.changeset/lovely-drinks-sort.md @@ -0,0 +1,5 @@ +--- +'@emotion/sheet': patch +--- + +Do not log failed rule insertions in the speedy mode for even more vendor-prefixed pseudo-elements/classes like `-webkit-scrollbar-button`, `-webkit-scrollbar-thumb` and `-webkit-scrollbar-track`. diff --git a/packages/sheet/src/index.js b/packages/sheet/src/index.js index 4fa90fbb6..09196a0d8 100644 --- a/packages/sheet/src/index.js +++ b/packages/sheet/src/index.js @@ -147,7 +147,7 @@ export class StyleSheet { } catch (e) { if ( process.env.NODE_ENV !== 'production' && - !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test( + !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal|-webkit-scrollbar-button:.*|-webkit-scrollbar-thumb:.*|-webkit-scrollbar-track:.*){/.test( rule ) ) { From 98b889acd5267d35fcfaa31bb28b182840cd00d6 Mon Sep 17 00:00:00 2001 From: Silas Lenz Date: Mon, 22 Jan 2024 11:18:54 +0100 Subject: [PATCH 2/2] Replace regex for specific pseudo-elements with a check for any webkit/moz/ms prefix --- .changeset/lovely-drinks-sort.md | 2 +- packages/sheet/src/index.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.changeset/lovely-drinks-sort.md b/.changeset/lovely-drinks-sort.md index 6b52ed63c..292806d79 100644 --- a/.changeset/lovely-drinks-sort.md +++ b/.changeset/lovely-drinks-sort.md @@ -2,4 +2,4 @@ '@emotion/sheet': patch --- -Do not log failed rule insertions in the speedy mode for even more vendor-prefixed pseudo-elements/classes like `-webkit-scrollbar-button`, `-webkit-scrollbar-thumb` and `-webkit-scrollbar-track`. +Do not log failed rule insertions in the speedy mode for vendor-prefixed (Webkit, Mozilla and Microsoft) pseudo-elements/classes diff --git a/packages/sheet/src/index.js b/packages/sheet/src/index.js index 09196a0d8..fdc505a3f 100644 --- a/packages/sheet/src/index.js +++ b/packages/sheet/src/index.js @@ -147,9 +147,7 @@ export class StyleSheet { } catch (e) { if ( process.env.NODE_ENV !== 'production' && - !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal|-webkit-scrollbar-button:.*|-webkit-scrollbar-thumb:.*|-webkit-scrollbar-track:.*){/.test( - rule - ) + !/:(-webkit-.*:.*|-moz-.*|-ms-.*){/.test(rule) ) { console.error( `There was a problem inserting the following rule: "${rule}"`,