Skip to content

Instantly share code, notes, and snippets.

@predaytor
Last active April 27, 2023 09:11
Show Gist options
  • Save predaytor/3c73ce7b78edcc8af7fd2628d431b92f to your computer and use it in GitHub Desktop.
Save predaytor/3c73ce7b78edcc8af7fd2628d431b92f to your computer and use it in GitHub Desktop.
Dotted linear-gradient
.gridLine {
--background: #ffffff;
--color: rgba(0, 0, 0, 0.5);
--height: 1px;
--width: 5px;
--fade-stop: 90%;
/* Bleed in or out from the container */
--offset: -100px;
position: absolute;
width: calc(100% + var(--offset));
height: var(--height);
left: calc(var(--offset) / 2 * -1);
background: linear-gradient(
to right,
var(--color),
var(--color) 50%,
transparent 0,
transparent
);
background-size: var(--width) var(--height);
/* Fade out the edges */
mask-composite: exclude;
-webkit-mask: linear-gradient(to left, var(--background) var(--fade-stop), transparent),
linear-gradient(to right, var(--background) var(--fade-stop), transparent),
linear-gradient(black, black);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment