Email or username:

Password:

Forgot your password?
Roma Komarov

I wrote a new article: “Indirect Cyclic Conditions: Prototyping Parametrized CSS Mixins”

kizu.dev/indirect-cyclic-condi

In my quest to push forward what is possible with custom properties in #CSS, I discovered another application of cyclic dependencies. Combined with a prior technique based on custom cascade layers, we are now even closer to something that resembles native CSS mixins.

A photo of the screen, zoomed onto a scheme that shows several blocks with solid and dashed arrows going between them. Most of the photo is out of focus, with the `--resize3` visible in the middle.
10 comments
Roma Komarov

As usual, the credits:

- @leaverou (conditions!)
- @tldraw (schemes!)
- @5t3ph (smol grid!)
- @heydon (original question!)
- @mia (mixins!)

the harbinger of eternal sept

@kizu i wrote a css tricks article at one point exploring and explaining how i use them—

pattern 5 was my take on mixins, using typography as the example

css-tricks.com/patterns-for-pr

Roma Komarov

@tychi Nice! But my article is about a very different application of custom properties — where they can be the _only_ external API of a mixin, with no class names or any other selectors associated :)

Dennis Frank

@kizu Thanks! What a xmas gift! Looking forward to explore your techniques in the coming days. ”Please do not apply this technique in production“ – well… we'll see about that 😅

Roma Komarov

@freshmango I mean, I _will_ use it for my personal web-site, haha. But yeah, not something where perf and stability matter :)

Mayank

@kizu this is so cool! a third of the way into your article, i was already thinking about the ways it could be used in production. and then that Firefox bug had to be there 😔

thank you for all the work you put into this!

Roma Komarov

@mayank The bug is workaroundable, and there was already a patch in the same day I reported it, but still, would've been better without it for sure!

Mayank

@kizu tbh it's not the specific bug that bothers me so much as the fact that this bug could even happen. it makes me feel unsure about the technique. what other bugs are out there that we haven't found?

Christopher Kirk-Nielsen

@kizu Okay I had to read the examples a couple times but now I understand it (the quote from the spec helped — who'd have thought! :D). This is really, really clever, and interesting. Thank you for sharing, and happy holidays!

Go Up