This is driving me crazy, I seem to not be able to apply a backdrop-filter: blur effect on my card element without keeping the text inside it just as sharp as it normally should be.
This issue was previously discussed here:
Text seems a bit blurry on a backdrop blur (html/css)
but I wonder if there is a "proper way" to fix/get around this without recurring to absolute positioning and creating additional elements, since I also have some translate animations on the element and it's just bloated like that...
comments are some attempts I read online for relative issues... the
childrenelement is only text...
here is the two text screenshotted and edited next to each other (over the white line is the text with
backdrop-filter: blur(0px)and under it is the text without it:
I tried some other css properties to add with backdrop-filter and was gonna try to fill the space with 0 opacity text and position: absolute another sibling text into it but refused to do it when it came down to tracking the animated div repeatedly.
I was expecting the text to not be influenced by the property.
How to reproduce
- Create a brand new react project with
npm create vite@latest->typescript + swc - Go into the
App.tsxfile in thesrcfolder - Let's take the last
<p>tag as a sample, add acard-glasscss class (and remove the defaultread-the-docsclass if you prefer) and put whatever text you want in it - Go into the
App.cssfile and add thecard-glasscss class:
.card-glass {
background-color: linear-gradient(180deg, #ffffff00, #ffffff88);
/* backdrop-filter: blur(0px); */
border-radius: 1em;
padding: 2em;
}
now you can toggle the commented backdrop-filter property to see the text being "antialiased" and smoothed when the property is on, even with 0px as value



