Is there anything in the CSS mixin, function and/or shape() syntax that will allow for repeating? I want to make a CSS shape() with 10px sawtooth effect. I'd love to calc() how many I need based on the width of the element
2 reposts10 likes
Is there anything in the CSS mixin, function and/or shape() syntax that will allow for repeating? I want to make a CSS shape() with 10px sawtooth effect. I'd love to calc() how many I need based on the width of the element
2 reposts10 likes
Wrote an explainer for --repeat() and I realized a way to help you even more easily with a --repeat-join() function bsky.app/profile/did:... There's a codepen demo in there using it with your sawtooth border-shape idea :) Hope it helps - ty for the inspiration!
How the 100% CSS --repeat() function works, some demos, and a really easy way for you to begin using it now! dev.to/janeori/100-...
We can even make it works with a dynamic repeat value 👀 codepen.io/t_afif/pen/Q... Really great technique 👍
Until then, a super hacky idea. demo: codepen.io/t_afif/pen/e... This gets you 6x6x6 = 216 repetition (I am doing the calculation right)
How about with mask or is it specifically shape() you need? codepen.io/editor/esolt...
The good news: you can put the repeated segment in a custom property and repeat that in a var() call, like in codepen.io/noamr-the-se... The bad news: CSS functions don't support for/while/recursion for perf reasons. So the number of repititions would have to be done explicitly or in a preprocessor.