Backdrop-filter doesn`t work

I am trying to build a login/register UI and i want to use the backdrop-filter to blur some background ( just expirementing). Here is the code in code pen https://codepen.io/nikas19/pen/wvVojor. The backdrop-filter doesn`t work.
74 Replies
ἔρως
ἔρως2mo ago
seems to be working to me
No description
Sleep Twitch
Sleep Twitch2mo ago
The problem is your background is just 1 solid color, so the blurred version of that looks exactly the same as the non blurred version. Another problem is that this: background: linear-gradient(rgba(255, 255, 255, 0.1)); isn't a valid background I think. You have a gradient with just 1 color?
Καλημερας
ΚαλημεραςOP2mo ago
So i have to provide an rgba value instead of a solid color? does it work without any changes? i saw it from a youtube tutorial, and it worked just fine. I dont know
ἔρως
ἔρως2mo ago
if that is the expected result, yes. i didnt change anything.
clevermissfox
clevermissfox2mo ago
You can indeed have one colour stop if it has transparency like this or if you use the 0s after but you need both “0”s
linear-gradient( rgba(255 255 255) 0 0) );
linear-gradient( rgba(255 255 255) 0 0) );
If you’re in safari , switch the order in the css so that the prefixed backdrop filter comes after background and before non-prefixed backdrop filter
background: linear-gradient( rgba(255, 255, 255, 0.1));
-webKit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
background: linear-gradient( rgba(255, 255, 255, 0.1));
-webKit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
ἔρως
ἔρως2mo ago
this last part should be handled by an auto-prefixer
Καλημερας
ΚαλημεραςOP2mo ago
I want to have the glass effect. tried this , didnt do anything Maybe a problem of CSS version? i dont know.
ἔρως
ἔρως2mo ago
what exactly isn't working? can you show it?
Καλημερας
ΚαλημεραςOP2mo ago
thats the result
Καλημερας
ΚαλημεραςOP2mo ago
No description
ἔρως
ἔρως2mo ago
ok, so? you can't blur a flat color
Καλημερας
ΚαλημεραςOP2mo ago
i want the container that wraps the form to be blured
ἔρως
ἔρως2mo ago
set a background color of rgba(255, 255, 255, 0.3)
Καλημερας
ΚαλημεραςOP2mo ago
The background color you see is from the container behind
ἔρως
ἔρως2mo ago
my answer stands
Καλημερας
ΚαλημεραςOP2mo ago
ook
ἔρως
ἔρως2mo ago
try it
Καλημερας
ΚαλημεραςOP2mo ago
No description
Καλημερας
ΚαλημεραςOP2mo ago
thats the result with your rgba
ἔρως
ἔρως2mo ago
then set a background color on the body
Καλημερας
ΚαλημεραςOP2mo ago
But if i want the background color of body to be white? Whats the point to change the body
ἔρως
ἔρως2mo ago
then set a background color on the parent of the element
Καλημερας
ΚαλημεραςOP2mo ago
I just did that you can check it in my code pen Is a big container ( the purple one) and inside i have 2 containers (as displayed by the borders ) which i want to be blured
Καλημερας
ΚαλημεραςOP2mo ago
No description
ἔρως
ἔρως2mo ago
you're right, you did and the background color still doesn't work because it's a flat color
Καλημερας
ΚαλημεραςOP2mo ago
No description
Καλημερας
ΚαλημεραςOP2mo ago
thats the background color of the parent
ἔρως
ἔρως2mo ago
yes, it's a flat color
Καλημερας
ΚαλημεραςOP2mo ago
oh really? To be honest , what is a flat color? i dont know
ἔρως
ἔρως2mo ago
it's the same color everywhere
Καλημερας
ΚαλημεραςOP2mo ago
So if i want the background to be this color but apply the blur to the child container , what should i do?
ἔρως
ἔρως2mo ago
you literally can't you have to have a gradient or something else you can't blur a flat color try adding background-image: url(https://placedog.net/500/280); to .user__container you will see it blurs
Καλημερας
ΚαλημεραςOP2mo ago
yeah it is~ !
ἔρως
ἔρως2mo ago
you will have to use a gradient or an image
Καλημερας
ΚαλημεραςOP2mo ago
tried this
No description
Καλημερας
ΚαλημεραςOP2mo ago
but still dont apply blur
Καλημερας
ΚαλημεραςOP2mo ago
(btw it looks pretty cool hahah)
No description
ἔρως
ἔρως2mo ago
which element do you want to blur?
Καλημερας
ΚαλημεραςOP2mo ago
the container which has borders the child of the parent
ἔρως
ἔρως2mo ago
you have 2 children from 2 parents that have borders register__area <-- these?
Καλημερας
ΚαλημεραςOP2mo ago
I have the parent which is the whole colored thing yes
ἔρως
ἔρως2mo ago
add background-color: rgba(255, 255, 255, 0.2);
ἔρως
ἔρως2mo ago
it looks like this
No description
ἔρως
ἔρως2mo ago
you need to have a background to be able to blur it
Καλημερας
ΚαλημεραςOP2mo ago
No description
ἔρως
ἔρως2mo ago
it's blurring, but very subtle
Καλημερας
ΚαλημεραςOP2mo ago
no its not
ἔρως
ἔρως2mo ago
yes it is check very carefully
Καλημερας
ΚαλημεραςOP2mo ago
i removed the blur line and nothing changed
ἔρως
ἔρως2mo ago
the gradient is less defined
Καλημερας
ΚαλημεραςOP2mo ago
even added some pixels to the blur and also nothing changed
ἔρως
ἔρως2mo ago
instead of being lighter add more stops to the gradient
Καλημερας
ΚαλημεραςOP2mo ago
what`s the point, yes we can achieve something like blur trying different things, but i want the backdrop-filter to be applied
ἔρως
ἔρως2mo ago
i did what im telling you and it works
Καλημερας
ΚαλημεραςOP2mo ago
what?
ἔρως
ἔρως2mo ago
this here i did it by adding a background color, and adding a non-uniform background to the parent
Καλημερας
ΚαλημεραςOP2mo ago
right now i have a gradient to the parent
Καλημερας
ΚαλημεραςOP2mo ago
No description
ἔρως
ἔρως2mo ago
and im saying to add more stops, and you will see it is working
Καλημερας
ΚαλημεραςOP2mo ago
No description
Καλημερας
ΚαλημεραςOP2mo ago
Can you please tell me what are stops?
ἔρως
ἔρως2mo ago
more colors in the gradient as many as you can
Καλημερας
ΚαλημεραςOP2mo ago
can you send me what you did is it a good practice ?
ἔρως
ἔρως2mo ago
it's exactly what a gradient is supposed to do you can add 50 if you want
Sleep Twitch
Sleep Twitch2mo ago
That's what I was trying to say.. you have 1 solid color, that's the problem. A blur of a solid color looks exactly the same as the solid color, if the area you try to blur is inside that solid color. You will only see blur on the edges.
ἔρως
ἔρως2mo ago
and even on the edges is very generous
Καλημερας
ΚαλημεραςOP2mo ago
I changed it to a gradient , but the blur still does not apply
Sleep Twitch
Sleep Twitch2mo ago
Can you show that example?
Καλημερας
ΚαλημεραςOP2mo ago
user__container
user__container
is the parent with the gradient,
register__area
register__area
is the child which i want to be blured right now i have selected a color with low opacity, so it looks like its blured but it isn`t If you play around with the
backdrop-filter
backdrop-filter
you ll see nothing is changing.
ἔρως
ἔρως2mo ago
No description
ἔρως
ἔρως2mo ago
the blur is working the gradient is too uniform as i said, add more colors to see the effect
Καλημερας
ΚαλημεραςOP2mo ago
Can you send me the css code of the gradient to copy-paste?
ἔρως
ἔρως2mo ago
there are million of gradient generators online just try one
Want results from more Discord servers?
Add your server