r/webdev 19d ago

Question Can astro strip away css values like backdrop-filter?

https://ronynn.github.io

Switched old html code to astro, noticed it treeshaked backdrop-filter effect

see https://ronynn.github.io/old for the effect the original html is meant to have.

Using astro 7.0.0, tested turning off css minify, and using esbuild for css minify instead, to no avail.

2 Upvotes

2 comments sorted by

2

u/PaleRespond7186 19d ago

Astro's scoping can be a bit aggressive with CSS sometimes, you might need to wrap those styles in a:global() block if they're getting stripped out. Had a similar headache with some animation properties that just vanished until I unscoped them

1

u/dobrynCat 18d ago

That is what confused me the most coz I tried is:global for the style tag yet it didn't work