- This topic has 6 replies, 2 voices, and was last updated 18 years, 9 months ago by Riyad Kalla.
-
AuthorPosts
-
rogue_devMemberI have the following CSS snippet
@media print { /* Document Body */ body { color: #000000; background-color: #ffffff; font-family: arial, helvetica, sans-serif; } }
Pressing CTRL-SHIFT-F for format produces:
@media print { /* Document Body */ body { color: #000000; background-color: #ffffff; font-family: arial, helvetica, sans-serif; } }
Pressing CTRL-SHIFT-F again produces:
@media print { /* Document Body */ body { color: #000000; background-color: #ffffff; font-family: arial, helvetica, sans-serif; } }
In addition all blank lines are removed, rather than a blank line between classes.
Riyad KallaMemberUsing 4.1, I got this after formatting your first sample:
@media print { /* Document Body */ body { color: #000000; background-color: #ffffff; font-family: arial, helvetica, sans-serif; } }
rogue_devMemberEcplise 3.1, MyEcplise 4.1.0GA.
Ok, in your code snippet, place the cursor just after the curly brace after the word print. Press ENTER (this will place the comment on its own line). Then CTRL-SHIFT-F. This happens consistently on my system.
At any rate, the comment should be just above the class name on its own line, not following the curly brace. And there should be a blank line between classes. This would follow the formatting already used if the media designator is not there.
With my live CSS file (over 500 lines, 50+ classes), I also get a strange visual effect. During the time that the formatter is working, the “body {” line disappears. Once the formatter has finished it appears again. Ths is on a 2.4GHz machine with 1G RAM.
Riyad KallaMemberPress enter after curley
@media print { /* Document Body */ body { color: #000000; background-color: #ffffff; font-family: arial, helvetica, sans-serif; } }
format
@media print { /* Document Body */ body { color: #000000; background-color: #ffffff; font-family: arial, helvetica, sans-serif; } }
BUT, if I format again, I get:
@media print { /* Document Body */ body { color: #000000; background-color: #ffffff; font-family: arial, helvetica, sans-serif; } }
I will file this, but first please provide us with the exact way the file “should” look, I want to make sure we have a test case.
rogue_devMemberOk, the way it “should” look is the way that it formats without a media designator. Except that everything is indented one level:
@media print { /* comment */ class_name { key: value; /* comment */ key: value; } /* multi-line comment */ class_name { key: value; key: value; } }
Note that I prefer curly braces to start on their own line 🙂
rogue_devMemberAnother thing.
If I have my CSS organized into sections, then I usually put a comment naming the section
/* *********************** table cells *********************** */ /* this is a number cell */ .table_cell_number { text-align: right; }
After a format, this becomes
/* *********************** table cells *********************** */ /* this is a number cell */ .table_cell_number { text-align: right; }
I think that the formatter should respect blank lines between successive comment blocks.
Riyad KallaMemberI believe this is already filed, if not, I’ll file it.
-
AuthorPosts