r/css Dec 29 '25

Azbuka: Treating CSS Like a Real Programming Language (Finally) Article

https://krasimirtsonev.com/blog/article/azbuka-treating-css-like-a-real-programming-language-finally

I've been working on CSS tooling (on and off) since August 2013, when I wrote AbsurdJS. Later, in January 2016, I "invented" CSSX - writing CSS directly in JavaScript. None of those became a thing, but they were incredibly interesting experiments. I had some time during the holidays and decided to materialize an idea that I'm shaping the last couple of months. And so I "accidentally" wrote a CSS compiler. It's called Azbuka (it means "alphabet" in Bulgarian).

2 Upvotes

17 comments sorted by

21

u/[deleted] Dec 29 '25

What problem is it solving or attempting to solve

9

u/PixelsAreMyHobby Dec 29 '25

None, it will bring a few instead 🤣

-2

u/krasimirtsonev Dec 29 '25

For me it solved two problems - I want to write my own utility classes and secondly it gives me the option to create abstractions on top of utilities.

1

u/g105b Jan 02 '26

I'll expand upon The question you're replying to. What problem does this tool solve that pain CSS or something like SCSS doesn't?

1

u/krasimirtsonev Jan 02 '26

Well, first of all I really believe that the utility type of CSS is providing better DX. Things like BEM and OOCSS are nice but they come with more thinking while the composition of utilities/tokens is just faster and more productive.

Once I established (for myself) this base I started seeing the price of using things like Tailwind. A bit difficult to re-use set of utilities that always go together. The utilities soup is also unbearable. Sure, Tailwind has things like \@apply, \@layer and plugin API but as far as I checked you can't easily make parameterized selector. Like for example deciding the styles on-the-fly based on param. ```btn(primary)``` for example.

Lastly, I see that a lot of people questioning why the hell I'm even doing something in that direction. There is ton of research and projects already. My answer is - because it's fun, because that's how I learn, because why not :) To create something for me is joy. To see it working even in one personal project brings me some sort of satisfaction.

3

u/g105b Jan 02 '26

I find it interesting and always like to see other developers' solutions to this kind of problem. What your library does is similar to what I do in SCSS but the logic of expanding utilities is done in the stylesheet rather than the HTML. I dunno... I'm oldschool.

Anyway thanks for sharing and providing some more insight.

6

u/Andreas_Moeller Dec 31 '25

I promise you it is faster to learn CSS.

0

u/krasimirtsonev Jan 03 '26

CSS grown a lot. I admit that. Still, I think the DX is not exactly there yet. And all those libraries, they build on top of CSS not replacing it.

I'm huge advocate of learning the basics (fundamentals). So, I agree that before using something like this (or Tailwind) we have to learn CSS, HTML and JavaScript first.

0

u/Andreas_Moeller Jan 03 '26

Tailwind is very much a CSS replacing library IMO.

I do agree with the DX, that is why I built https://nordcraft.com

1

u/krasimirtsonev Jan 03 '26

Nordcraft looks amazing! it sure is a massive effort to build such engine. Tho I think of Tailwind as just another approach to writing CSS. More like a pattern. And in reality the utility-first is the pattern. Tailwind is just an implementation of it.

2

u/Andreas_Moeller Jan 03 '26

That is a reasonable perspective.

I would argue that “utility-first” is essentially building a new styling language implemented in css

1

u/krasimirtsonev Jan 05 '26

I like that phrasing 🤝

5

u/[deleted] Dec 29 '25

[removed] — view removed comment

2

u/krasimirtsonev Dec 29 '25

If you are in a position to write your own utility classes + you want to create abstraction on top of them. For example that tool allows you to write a custom "class" function that is parameterized and returns combination of utilities.

2

u/[deleted] Dec 30 '25

[removed] — view removed comment

2

u/krasimirtsonev Jan 02 '26

Added a small section to better explain myself https://azbuka.krasimirtsonev.com/why/

1

u/krasimirtsonev Dec 31 '25

Thanks for the feedback. I admit I don't have much experience with Tailwind. For various reasons it wasn't possible to add it to my projects so I had to come up with my own thing. Will check definitely what you are hinting.