Last active
April 27, 2023 09:11
-
-
Save predaytor/3c73ce7b78edcc8af7fd2628d431b92f to your computer and use it in GitHub Desktop.
Dotted linear-gradient
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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