thetooi / zen-coding

Automatically exported from code.google.com/p/zen-coding
0 stars 0 forks source link

CSS Beautifier #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It'd be nice to have this feature in Zen-Coding.

There can be a lot of settings, here I'll write some that come to my mind 
now:

1. A space after property — «zoom:1» vs. «zoom :1»

2. The case of tag selectors — «div.class {…}» vs. «DIV.class {…}»

3. The case of color definitions — «#e7e7e7» vs. «#E7E7E7»

4. Newline before opening curly brace after selector — «DIV.class {» vs. 
«DIV.class\n{»

5. A tab before closing bracket (and an extra newline after) — «}\n» vs. 
«    }\n\n»

6. An order of parts in some properties — «background:#FFF url(…) 0 0 no-
repeat» vs. «background:url(…) no-repeat 0 0 #FFF»

…and so on.

Also, there need to be some non-setting things like converting uppercase 
units to lowercase, adding a space after url() in backgrounds, converting 
«0px» to «0», «2px 3px 1px 3px» to «2px 3px 1px» and so on.

And as a last thing: there can be an almost killer feature with that — zen-
coding collapser/expander for css rules, that'd work like following: we 
have a rule, after pressing shortcut we get minified version (in one line 
with all extra whitespaces eaten) and after pressing shortcut again we'd 
get this rule expanded with all the settings that I wrote above.

Original issue reported on code.google.com by kizmarh on 18 Feb 2010 at 10:02

GoogleCodeExporter commented 9 years ago
Zen Coding isn't meant to be a programming language. It does cover items 1 and 2
already though. Many editors already offer the features that you mention. I 
don't see
much benefit in trying to embed them into ZC as it would be more cumbersome to 
use.
Some of the features will likely find their way in, but others I don't see 
benefit in.

Original comment by angelw...@gmail.com on 19 Feb 2010 at 12:00

GoogleCodeExporter commented 9 years ago
Well, I didn't made myself clear, sorry, right now I'm talking not about some 
filters or the autocomplete, but about the code refactoring of an existent css 
code 
— although the refactoring or expand/collapse feature can't make zen-coding 
more 
cumbersome — no one is forcing coders to use these particular features. And 
my 
proposal are not so critical, but something that I personally want to see in 
zen-
coding, if there would be time to do them — excellent, if no — it's ok, I 
don't 
insist.

Original comment by kizmarh on 19 Feb 2010 at 12:18

GoogleCodeExporter commented 9 years ago
CSS Beautifier should be a separate project because it contains too many 
options for end user and can't be 
integrated in ZC as simply a feature.

Original comment by serge....@gmail.com on 19 Feb 2010 at 11:46