Skip to main content
Topic: Thought about CSS files. (Read 24030 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Thought about CSS files.

Reply #30

Bonzer. :) The old SMF way was to keep comments minimal. It was hard to get them to keep any comments, apart from the most basic, but then they didn't have auto minifying back then. We can afford to be more luxurious now. I like it. :)

Also, I'm going to start ordering stuff according to this bloke's system: http://csscomb.com/

I've looked through it, and his way is pretty much how I prefer to do it anyway. The differences are few and logical, so I think just adopting CSSComb's default ordering is sensible. This will help when reading long declarations, since it's easier to find a margin or whatever if it's consistently in the same place.

I've tried the online resort tool with the current local host version of index.css. Resorting is quite fast and seems to be very good. The only thing it seems to have trouble with is comments in odd places. This is fine:

Code: [Select]
.some_class {
/* Comment here. */
margin: 0;
padding: 0;
background: #555;
}

This will break sorting:

Code: [Select]
.some_class { /* Oh hai, I stuck temporary comment here during devz! */
  margin: 0;
padding: 0;
background: #555;
}

So, as long as I (and anyone else) uses a neater commenting style even for temp stuff, CSScomb should be fine.
Obviously, it'd still make sense to test the resorted file before committing anything.
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P