You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: warnings when compiling Ionic css with lightningcss - ionic outputs deprecated host-context pseudo-class #30024
Looks like host-context is probably being removed from the spec anyways. So maybe this issue should just be to remove deprecated host-context from Ionic usage.
changed the title [-]bug: warnings when compiling Ionic css with lightningcss[/-][+]bug: warnings when compiling Ionic css with lightningcss - ionic outputs deprecated host-context pseudo-class[/+]on Nov 19, 2024
If you are using Vite 8 and you want to avoid this warning, you can set minify to esbuild in vite.config.ts:
return defineConfig({
build: {
// Use esbuild for CSS minification instead of the Vite 8 default
// (lightningcss), which warns about Ionic's :host-context()
// pseudo-class.
cssMinify: 'esbuild',
I recently update to vite 8 and now get these warnings in my build output. Changing cssMinify to esbuild doesn't fix it for me. Would appreciate it if this could get fixed sooner rather than later.
Activity
aeharding commentedon Nov 19, 2024
Looks like host-context is probably being removed from the spec anyways. So maybe this issue should just be to remove deprecated host-context from Ionic usage.
parcel-bundler/lightningcss#545 (comment)
w3c/csswg-drafts#1914 (comment)
[-]bug: warnings when compiling Ionic css with lightningcss[/-][+]bug: warnings when compiling Ionic css with lightningcss - ionic outputs deprecated host-context pseudo-class[/+]reslear commentedon Sep 30, 2025
any news?
aeharding commentedon Mar 14, 2026
Lightningcss appears to be the default in Vite 8, so now anyone building an Ionic app with Vite will see this error.
ptmkenny commentedon Apr 3, 2026
If you are using Vite 8 and you want to avoid this warning, you can set minify to esbuild in
vite.config.ts:jacobg commentedon May 5, 2026
Is a fix planned for this?
fabian-meisinger commentedon May 19, 2026
I recently update to vite 8 and now get these warnings in my build output. Changing cssMinify to esbuild doesn't fix it for me. Would appreciate it if this could get fixed sooner rather than later.
Alain-Bearez commentedon Sep 26, 2026
Working workaround consists in wrapping the default logger to make it silent about
host-contextinside thevite.config.tsat the root of the project.ShaneK commentedon Oct 2, 2026
Hey everyone, thanks for your patience on this issue! This has been resolved in #31516 and will be released in our next patch release
fix(css): stop emitting :host-context selectors in global stylesheets (…
ShaneK commentedon Oct 7, 2026
This has been fixed in v9.0.7!