From b485f7ace59b7aecbe96612e270004eb6f9d2ea3 Mon Sep 17 00:00:00 2001 From: Ryan Swanson Date: Fri, 18 Jul 2025 14:07:32 -0400 Subject: [PATCH 1/2] Fix createUnsafeSelectorsAlarm to handle multi-line parsed styles. May fix issue #2917. This issue was introduced with changes for Issue #2751. Column (character position) comparison only applies within the same line. --- packages/cache/src/stylis-plugins.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cache/src/stylis-plugins.ts b/packages/cache/src/stylis-plugins.ts index f007fb425..fb5df0a81 100644 --- a/packages/cache/src/stylis-plugins.ts +++ b/packages/cache/src/stylis-plugins.ts @@ -217,7 +217,7 @@ export let createUnsafeSelectorsAlarm = // } // with such inputs we wouldn't have to search for the comment at all // TODO: consider changing this comment placement in the next major version - if (node.column < element.column) { + if (node.line === element.line && node.column < element.column) { if (isIgnoringComment(node)) { return } From 42ae0f130a44b50a28b3cf0d01fe99a820084c98 Mon Sep 17 00:00:00 2001 From: Ryan Swanson Date: Fri, 18 Jul 2025 15:04:01 -0400 Subject: [PATCH 2/2] Added changeset --- .changeset/long-taxis-give.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/long-taxis-give.md diff --git a/.changeset/long-taxis-give.md b/.changeset/long-taxis-give.md new file mode 100644 index 000000000..1f7612461 --- /dev/null +++ b/.changeset/long-taxis-give.md @@ -0,0 +1,5 @@ +--- +'@emotion/cache': patch +--- + +Fix Issue #2917 - Update createUnsafeSelectorsAlarm to handle multi-line parsed styles