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
ἔρως
ἔρως3mo ago
seems to be working to me
No description
Sleep Twitch
Sleep Twitch3mo 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?
Καλημερας
ΚαλημεραςOP3mo 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
ἔρως
ἔρως3mo ago
if that is the expected result, yes. i didnt change anything.
clevermissfox
clevermissfox3mo 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);
ἔρως
ἔρως3mo ago
this last part should be handled by an auto-prefixer
Καλημερας
ΚαλημεραςOP3mo ago
I want to have the glass effect. tried this , didnt do anything Maybe a problem of CSS version? i dont know.
ἔρως
ἔρως3mo ago
what exactly isn't working? can you show it?
Καλημερας
ΚαλημεραςOP3mo ago
thats the result
Καλημερας
ΚαλημεραςOP3mo ago
No description
ἔρως
ἔρως3mo ago
ok, so? you can't blur a flat color
Καλημερας
ΚαλημεραςOP3mo ago
i want the container that wraps the form to be blured
ἔρως
ἔρως3mo ago
set a background color of rgba(255, 255, 255, 0.3)
Καλημερας
ΚαλημεραςOP3mo ago
The background color you see is from the container behind
ἔρως
ἔρως3mo ago
my answer stands
Καλημερας
ΚαλημεραςOP3mo ago
ook
ἔρως
ἔρως3mo ago
try it
Καλημερας
ΚαλημεραςOP3mo ago
No description
Καλημερας
ΚαλημεραςOP3mo ago
thats the result with your rgba
ἔρως
ἔρως3mo ago
then set a background color on the body
Καλημερας
ΚαλημεραςOP3mo ago
But if i want the background color of body to be white? Whats the point to change the body
ἔρως
ἔρως3mo ago
then set a background color on the parent of the element
Καλημερας
ΚαλημεραςOP3mo 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
Καλημερας
ΚαλημεραςOP3mo ago
No description
ἔρως
ἔρως3mo ago
you're right, you did and the background color still doesn't work because it's a flat color
Καλημερας
ΚαλημεραςOP3mo ago
No description
Καλημερας
ΚαλημεραςOP3mo ago
thats the background color of the parent
ἔρως
ἔρως3mo ago
yes, it's a flat color
Καλημερας
ΚαλημεραςOP3mo ago
oh really? To be honest , what is a flat color? i dont know
ἔρως
ἔρως3mo ago
it's the same color everywhere
Καλημερας
ΚαλημεραςOP3mo ago
So if i want the background to be this color but apply the blur to the child container , what should i do?
ἔρως
ἔρως3mo 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
Καλημερας
ΚαλημεραςOP3mo ago
yeah it is~ !
ἔρως
ἔρως3mo ago
you will have to use a gradient or an image
Καλημερας
ΚαλημεραςOP3mo ago
tried this
No description
Καλημερας
ΚαλημεραςOP3mo ago
but still dont apply blur
Καλημερας
ΚαλημεραςOP3mo ago
(btw it looks pretty cool hahah)
No description
ἔρως
ἔρως3mo ago
which element do you want to blur?
Καλημερας
ΚαλημεραςOP3mo ago
the container which has borders the child of the parent
ἔρως
ἔρως3mo ago
you have 2 children from 2 parents that have borders register__area <-- these?
Καλημερας
ΚαλημεραςOP3mo ago
I have the parent which is the whole colored thing yes
ἔρως
ἔρως3mo ago
add background-color: rgba(255, 255, 255, 0.2);
ἔρως
ἔρως3mo ago
it looks like this
No description
ἔρως
ἔρως3mo ago
you need to have a background to be able to blur it
Καλημερας
ΚαλημεραςOP3mo ago
No description
ἔρως
ἔρως3mo ago
it's blurring, but very subtle
Καλημερας
ΚαλημεραςOP3mo ago
no its not
ἔρως
ἔρως3mo ago
yes it is check very carefully
Καλημερας
ΚαλημεραςOP3mo ago
i removed the blur line and nothing changed
ἔρως
ἔρως3mo ago
the gradient is less defined
Καλημερας
ΚαλημεραςOP3mo ago
even added some pixels to the blur and also nothing changed
ἔρως
ἔρως3mo ago
instead of being lighter add more stops to the gradient
Καλημερας
ΚαλημεραςOP3mo ago
what`s the point, yes we can achieve something like blur trying different things, but i want the backdrop-filter to be applied
ἔρως
ἔρως3mo ago
i did what im telling you and it works
Καλημερας
ΚαλημεραςOP3mo ago
what?
ἔρως
ἔρως3mo ago
this here i did it by adding a background color, and adding a non-uniform background to the parent
Καλημερας
ΚαλημεραςOP3mo ago
right now i have a gradient to the parent
Καλημερας
ΚαλημεραςOP3mo ago
No description
ἔρως
ἔρως3mo ago
and im saying to add more stops, and you will see it is working
Καλημερας
ΚαλημεραςOP3mo ago
No description
Καλημερας
ΚαλημεραςOP3mo ago
Can you please tell me what are stops?
ἔρως
ἔρως3mo ago
more colors in the gradient as many as you can
Καλημερας
ΚαλημεραςOP3mo ago
can you send me what you did is it a good practice ?
ἔρως
ἔρως3mo ago
it's exactly what a gradient is supposed to do you can add 50 if you want
Sleep Twitch
Sleep Twitch3mo 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.
ἔρως
ἔρως3mo ago
and even on the edges is very generous
Καλημερας
ΚαλημεραςOP3mo ago
I changed it to a gradient , but the blur still does not apply
Sleep Twitch
Sleep Twitch3mo ago
Can you show that example?
Καλημερας
ΚαλημεραςOP3mo 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.
ἔρως
ἔρως3mo ago
No description
ἔρως
ἔρως3mo ago
the blur is working the gradient is too uniform as i said, add more colors to see the effect
Καλημερας
ΚαλημεραςOP3mo ago
Can you send me the css code of the gradient to copy-paste?
ἔρως
ἔρως3mo ago
there are million of gradient generators online just try one
Want results from more Discord servers?
Add your server