Re: I Updated that CSS Formatter Page (Feedback Please)

Lonnie Best wrote:
> I recently made a page that allows you to format your CSS by simply pasting
> it into this box:
> 
> http://www.lonniebest.com/FormatCSS/
> 
> As a result of your *much appreciated* feedback, I have added an options
> menu to accommodate the varying preferences that people have mentioned.

Now that the alphabetising can be disabled, it may possibly be a useful 
tool.  One bug I found is that if there is a space between the value and 
semi-colon, the entire property is removed.

try:

foo { color: green ; }

Look up the CSS test suite and find the tests that specifically test 
parsing, run them through your parser and make sure the results are as 
expected.  I suspect you may find quite a few other bugs.

Other useful feature ideas:
* Allow user to specify the number of spaces/tabs to insert.  Some 
people may like 1 tab, while others may prefer 2 spaces, 4 spaces or 
anything else.
* Leave the alphabetising features unchecked by default.
* Add an option to make lines wrap between properties, after a specified 
number of characters.  i.e. I like to format my CSS like this:

foo bar baz { property-one: value; property-two: value;
               property-three: value; property-four: value; }

-- 
Lachlan Hunt
http://lachy.id.au/

Received on Tuesday, 13 December 2005 13:29:02 UTC