postcss / sugarss

Indent-based CSS syntax for PostCSS
MIT License
707 stars 39 forks source link

Colons and commas #19

Closed tjconcept closed 8 years ago

tjconcept commented 8 years ago

I prefer the syntax of Stylus code but the modularity and community of PostCSS. This module is very close to giving me both, but there are two major differences, and I would like to hear the reasoning behind - I might just be "on the wrong side":

  1. Colons

    fotter
     color: #333

    You got rid of the ending semi-colon, but not the colon in color:. Why not? Is there ever going to be multi-word css keywords? Could it be optional?

  2. Commas

    footer,
    main
     color: #333

    I am one of those people who put , at the end of array items or object entries because I don't like juggling the comma around when adding items, moving lines and having another affected line in a git diff.

    I can see how supporting non-comma would break with your current approach of allowing newlines in selectors. Is anyone actually doing that?

ai commented 8 years ago

@tjconcept about colons. We have two reasons:

  1. We use colons to selector/property detection. Stylus doesn’t have simple way to write multilines selectors and property values, so it can miss a colon.
  2. Most of developers ask me to leave a colons. Even many Stylus developers prefer colons.
ai commented 8 years ago

@tjconcept about commas. Yeap, commas is used in multiline.

ai commented 8 years ago

Technically, you can form SugarSS and keep all that you love in Stylus by removing multilines support.

But I think it is not big deal and it will be better to learn new thing. I am perfectionist too. But sometimes bit community is better than few small features :).

tjconcept commented 8 years ago

Hmm.. I hear you, and I might try living with it, but I am not convinced that "multiline selectors" is a better tradeoff than "optional colons" and "comma-less multi-selectors".

Thanks, that was great insight.

tjconcept commented 7 years ago

I still have on my to-do to fork this repo and create a Stylus version. It might happen in 2016. Just wanted to leave this link here showing that Stylus is still relevant: http://stateofjs.com/2016/css/

ai commented 7 years ago

This surgery is very bad in CSS section. He has CSS Modules and PostCSS. But CSS Modules is a PostCSS-based technology :(.

You agree, that old preprocessors is more popular that PostCSS-based preprocessors (SugarSS and PreCSS, PostCSS is not a preprocessor).

But, I think comma-less SugarSS will not change it ;). Users don’t more to PreCSS/SugarSS because Sass/Stylus already serve all they needs. Modularity is not so important thing. Users want a real benefits.

Look at PostCSS-based CSS Modules — they are very popular. It very popular not because of syntax and comma. But because of new level of isolation. Isolation is a real benefit, instead of syntax.

This is why I am think comma-less SugarSS is not a big deal ;).