Hacker News new | ask | show | jobs
by weego 1770 days ago

  x-style="max-w:80; mx:auto; radius:md; e:2; e.hover:4; transition:all 0.25s; cursor:pointer"
How many times do we have to be told they're not reinventing the wheel while reinventing the wheel! This is not better than just writing CSS.

'Proxy' DSLs are not a solution to anything other than "how to do I make sure the next person taking on this codebase will want to delete all my shit and start again clean and coherent"

If you're at the point where you're getting people to write the style attribute in your own DSL so you can claim some marginal utility gains then you're missing the point of what makes CSS difficult for coders to deal with: how do you describe visual complexity in code. How does x-style="e:2;" solve a problem that the 'contract' between designer and developer has?

5 comments

Assembler CSS doesn't look very good and I wouldn't use it ... but I have come to absolutely love utility CSS through Tailwind. Tailwind's documentation does a good job explaining why: https://tailwindcss.com/docs/utility-first

It's really not very similar to writing inline styles, nor is it about saving keystrokes. It's about very quickly and confidently translating a design in your mocks (or your head) into working CSS which draws from a finite design system that you control.

It't not something I'd use on mywebsite.com/about.html but it pairs really nicely with modern JS frameworks which allow you to create custom elements with scoped styles.

They reinvent inline styles, then they reinvent classes! It's kind of impressive.

I read through the docs, trying to find a value proposition to this over CSS. So far, the benefits claimed amount to "knowing how to use development tools is scary", "you can abbreviate properties into incomprehensibility", "here are some new values and defaults to keep straight".

In terms of what you can't do with plain old inline CSS? Apparently, just some parlor tricks like styling sub-elements (with a cumbersome syntax) and some concise transitions.

> In terms of what you can't do with plain old inline CSS?

AFAIK you cannot do responsive stuff (media queries) in the style attribute.

I don't see than you can really work with arbitrary media queries in this, either. There are just some combinations of widths and orientations baked in, which is nothing new.
You're right that you still cannot do arbitrary media queries there. But from my experience (I'm not a designer though), staying within a set of predefined breakpoints (xs, sm, md, lg, xl) is often enough for most web pages.

The style attribute doesn't allow you to do anything responsive at all on the other hand.

That's what classes are for. (Which this also reinvents.)
Interestingly enough, the syntax of this reinvented CSS reminds me of an old style sheet language proposal created by Bert Bos in March 1995 [0]:

``` […] id: !ID language: !LANG *target: !ID

! Create a default margin of 3 em ! HTML.leftindent: 3.0 HTML.justify: full […] ```

[0]: https://www.wiumlie.no/2006/phd/archive/odur.let.rug.nl/~ber...

My first impression is it's kind of like a transpiler or Babel for CSS. I agree with your sentiment and I wouldn't use it, but let others have their fun I guess.
> let others have their fun

We can't afford this attitude unfortunately, these people don't work in a bubble, teammates have to clean up after them and gullible people in the industry are lured into it.

There is a domino effect and next thing you know it is actually now the norm to write styles like this, started way back with bootstrap.

Then actually knowing how to use real CSS becomes a competitive advantage.
In defence of Tailwind: https://news.ycombinator.com/item?id=27763835

But Assembler CSS looks like an overly elaborate joke