Skip to content

Instantly share code, notes, and snippets.

@gursuj
Created August 20, 2025 07:44
Show Gist options
  • Select an option

  • Save gursuj/4e7f2fd863e47315a8a850df02298cfe to your computer and use it in GitHub Desktop.

Select an option

Save gursuj/4e7f2fd863e47315a8a850df02298cfe to your computer and use it in GitHub Desktop.
This should be used on elements w/ black backgrounds like in distinctstudios.com.np
selector {
--blur-width: 50px;
position: relative;
/* blur edges */
&:before,
&:after {
content: "";
position: absolute;
z-index: 10;
width: var(--blur-width);
top: 0;
height: 100%;
pointer-events: none;
}
&:before {
left: 0;
background: linear-gradient(to right, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0));
}
&:after {
right: 0;
background: linear-gradient(to left, rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 0));
}
}
@media (max-width:767px) {
selector { --blur-width: 25px; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment