From a916b4149a7c9d088efc94e9b750eb96e020dbc9 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 9 Oct 2025 11:48:57 +0200 Subject: [PATCH 1/2] suppress warnings when using `:deep`, `:slotted` and `:global` --- packages/@tailwindcss-node/src/optimize.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/@tailwindcss-node/src/optimize.ts b/packages/@tailwindcss-node/src/optimize.ts index 0fc75210274b..6e60f8b873f6 100644 --- a/packages/@tailwindcss-node/src/optimize.ts +++ b/packages/@tailwindcss-node/src/optimize.ts @@ -60,6 +60,17 @@ export function optimize( let result = optimize(Buffer.from(input), map) map = result.map?.toString() + result.warnings = result.warnings.filter((warning) => { + // Ignore warnings about unknown pseudo-classes as they are likely caused + // by the use of `:deep()`, `:slotted()`, and `:global()` which are not + // standard CSS but are commonly used in frameworks like Vue. + if (/'(deep|slotted|global)' is not recognized as a valid pseudo-/.test(warning.message)) { + return false + } + + return true + }) + // Because of `errorRecovery: true`, there could be warnings, so let's let the // user know about them. if (process.env.NODE_ENV !== 'test' && result.warnings.length > 0) { From c1377563f04249669d4c67e713346a19059b03e5 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 9 Oct 2025 11:54:16 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a9ccfdab991..98231ff237fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix Safari devtools rendering issue due to `color-mix` fallback ([#19069](https://github.com/tailwindlabs/tailwindcss/pull/19069)) +- Suppress Lightning CSS warnings about `:deep`, `:slotted` and `:global` ([#19094](https://github.com/tailwindlabs/tailwindcss/pull/19094)) ## [4.1.14] - 2025-10-01