Skip to content

Instantly share code, notes, and snippets.

@weilinzung
Created August 26, 2026 15:37
Show Gist options
  • Select an option

  • Save weilinzung/ace42ceb95c2f47b6747cc1f34f162bd to your computer and use it in GitHub Desktop.

Select an option

Save weilinzung/ace42ceb95c2f47b6747cc1f34f162bd to your computer and use it in GitHub Desktop.
Reproduction: Tailwind CSS optimizer warns on Angular's ::ng-deep

::ng-deep optimizer warning reproduction

optimizeCss filters Lightning CSS warnings for :deep(), :slotted() and :global(), but not for Angular's ::ng-deep, so every Angular component stylesheet using it prints a warning block per occurrence.

npm install
npm run build

Expected: the compiled CSS, no warnings. Actual: two 'ng-deep' is not recognized as a valid pseudo-element warnings on stderr.

@import 'tailwindcss';
import postcss from 'postcss';
import tailwindcss from '@tailwindcss/postcss';
import fs from 'node:fs';
const file = new URL('./component.css', import.meta.url).pathname;
const result = await postcss([tailwindcss({ optimize: true })]).process(fs.readFileSync(file, 'utf8'), {
from: file,
});
console.log(result.css);
@reference './app.css';
:host {
::ng-deep .some-child,
::ng-deep .other-child {
@apply text-sm;
}
}
{
"name": "tailwind-ng-deep-warning-repro",
"private": true,
"type": "module",
"scripts": { "build": "node build.mjs" },
"dependencies": {
"@tailwindcss/postcss": "4.3.3",
"postcss": "8.5.6",
"tailwindcss": "4.3.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment