This is a great idea. Too bad code can't really be isolated this way. I feel that marking a hack is one of the few legitimate uses for comments in code: //TODO HACK HACK HACKITY HACK
I feel that marking a hack is one of the few legitimate uses for comments in code
I'll take that as an offhand comment you didn't give much thought to, because wow, there most certainly are lots of legitimate uses for comments in code.
I don't like this idea since it separates your hack CSS from the CSS it's supposed to hack. It's an even bigger problem when you're using SCSS and you have to reproduce the entire selector tree for your hacks.
Some of this can/should be done via a CSS system like SASS/Compass. If you're littering overflow:auto into a dozen rules, SASS/Compass would probably help you immensely. When you eventually decide IE6 support isn't needed, flip a single variable and poof--those rules disappear. You could extend this to a _shame.sass file too, of course.
I'll add another vote for SASS/Compass. That system has saved me tons of heartache and hair-rending (and I don't have the hair to spare). SASS makes it easier to organize your CSS than to leave it unorganized. It almost makes CSS fun.
Pedantry: can we call it "guilt.css" instead? In psychological literature, guilt is defined as the "I did something bad" emotion, shame is the "I am bad" emotion. The crucial difference between them is that guilt can be fixed by making amends. That seems like exactly the mindset you want to encourage with this: guilt.css implies that you feel guilty about all the hacks you have and want to make amends, while shame.cs…
I also don't know the psych lingo, but I thought right away of the anthropological distinction between cultures of shame[1] (external disapproval from other people) and guilt[2] (internal disapproval from self). On that score, either could work: shame is certainly appropriate here since devs shame each other all the time.
Pedantry: can we call it "guilt.css" instead? In psychological literature, guilt is defined as the "I did something bad" emotion, shame is the "I am bad" emotion. The crucial difference between them is that guilt can be fixed by making amends. That seems like exactly the mindset you want to encourage with this: guilt.css implies that you feel guilty about all the hacks you have and want to make amends, while shame.cs…
yea it's common to say guilt is feeling bad for _something you did_ while shame is feeling bad for _something you are_. But I actually like the use of shame here because it's a light hearted self-deprecating jab announcing "I'm a bad coder." I also think the externalization aspect lies in favor of shame i.e. "hide your shame!"
This is a great idea and to be honest the only time I ever use hacks is when I am adding in compatibility for IE8. I disagree with the !important declaration though. I use LESS for writing CSS and while it's definitely a valuable asset to have, the ability to nest and have super specific queries generated means when you'e writing media queries, you sometimes don't want to have to replicate the nesting and specificiti…
Using !important 9 times out of 10 means you're doing something wrong. Many developers rely on it as a lazy tool for various reasons (bloated unmanageable css files, lack of knowledge, etc.) The media query example and overriding third party code you can't edit are the 1 in 10 examples. I would even possibly debate the media query situation as it is being a bit lazy IMHO.
Pedantry: can we call it "guilt.css" instead? In psychological literature, guilt is defined as the "I did something bad" emotion, shame is the "I am bad" emotion. The crucial difference between them is that guilt can be fixed by making amends. That seems like exactly the mindset you want to encourage with this: guilt.css implies that you feel guilty about all the hacks you have and want to make amends, while shame.cs…
I don't know about psychological literature, but in common usage where I'm from, "guilt" is what you feel when you know you've done something you shouldn't, whereas "shame" is what you feel when you believe others either do or will frown on something. In that context, I think "shame" is more appropriate — essentially, it's a collection of code that brings some degree of shame to the project, not code that you should…
how about bandaids.css or kludge.css? Get out of the psychology and name the noun.
We have the same thing in Javascript, we call it 'hacks.js'. That's the place you go when things are broken and you're not yet ready to pay down tech debt. Hacks.css sounds nicer than shame.
I would normally agree with you, but the term "hack" in css already has a relatively well defined meaning as "goofy piece of CSS to work around a browser bug"[1]. While I do think it's appropriate to isolate such things so you can remove them when you stop supporting a browser, I don't think they'd belong in a shame.css file. Then again, maybe that's just getting too fetishistic about organizing code.