Skip to content

Instantly share code, notes, and snippets.

@lonekorean
Created March 3, 2018 14:14
Show Gist options
  • Save lonekorean/e16813c265817a102110a71c4baa2372 to your computer and use it in GitHub Desktop.
Save lonekorean/e16813c265817a102110a71c4baa2372 to your computer and use it in GitHub Desktop.
Setting custom properties for a paint worklet to use
.jagged {
background: paint(jagged-edge);
/* other styles as needed... */
}
.slot:nth-child(1) .jagged {
--tooth-width: 50px;
--tooth-height: 25px;
}
.slot:nth-child(2) .jagged {
--tooth-width: 2rem;
--tooth-height: 3rem;
}
.slot:nth-child(3) .jagged {
--tooth-width: calc(33vw - 31px);
--tooth-height: 2em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment