I'm not much of a fan of collapsing my code within the editor... it just confuses more more than anything most of the time. Perhaps if there was a better indicator that there was collapsed code.
However, I work with 500+-line CSS files every day, and we do a decent job grouping these into sections visually through commenting. It would be great if we could collapse any one of these "sections" as to help with general organization, etc. A typical style sheet for us would look like this:
/* | 3. Site Structure |________________________________________________________ */
(structure styles)
/*_______________________________________________________ */
/* | 4. Front Page |________________________________________________________ */
(front-page specific styles)
/*_______________________________________________________ */
I'm pretty sure all that would be needed for this are some standardized tokens that need to appear at the section 'bookends.' So...
/*** | 4. Front Page |________________________________________________________ */
...
/*______________________________________________________***/
Preferably looking like this when collapsed:
/*** | 4. Front Page |________________________________________________________ */
And then the rule would be start collapse at first instance of *** and end at the next instance of ***. We may want to argue for a few hundred e-mails on what a more unique token could be, and then there's the issue of standardizing comment markup so that we can all use it.... i'm sure it'd be easy enough to do for one example but to account for other peoples' styles...
Thoughts on this? Anyone feel like whipping this up? I've never done any bundle editing before but i could give it a whril so long as we feel this is worthwhile and i've got all the rules down.
On 23/8/2006, at 21:24, Eric D. Fields wrote:
[...] I'm pretty sure all that would be needed for this are some standardized tokens that need to appear at the section 'bookends.'
CSS already supports folding on ‘/**’ and ‘**/’.
So that would be either:
/** fold start marker */ …lots of CSS… /* fold stop marker **/
Or:
/** very big * comment with * lots of info **/
If you paste the above in a CSS file you will see how it can be folded.
On Aug 23, 2006, at 7:20 PM, Allan Odgaard wrote:
CSS already supports folding on ‘/**’ and ‘**/’.
Huh, did not know that.
I've been using my own custom CSS wrapper just to add CSSEdit.app style folding comments.
thomas Aylott — subtleGradient — CrazyEgg
So the following format also allows one to see the comment topic tags when folded.
/** 3. Site Structure | |________________________________________________________ */
(structure styles)
/*_______________________________________________________ **/
/** 4. Front Page | |________________________________________________________ */
(front-page specific styles)
/*_______________________________________________________ **/
It is a slight modification to the top comment, but allows one to see the subject when folded.