css
Knowing Your Body and Practicing Safe CSS
This is a quick trick I picked up to guarantee that any css changes you make only affect what you want.
There are different ways to identify the page you need to change. I tend to use url as it's always unique.
Here's how:
Locate the template.php file for the theme your working on and add something like this to the page_preprocess function
- function your_theme_preprocess_page(&$vars) {
- // Add a custom body class for specifc page
- if ($_REQUEST['q'] == 'example/page/new-body-class') {
- $vars['body_classes'] .= ' custom-body-class-name ';
- }
IE Blew Up My Layout!!!
We've all experienced it, you've themed out a page and it looks fantastic in Firefox. Unfortunately the time has arrived for your IE testing... You've dreaded it the entire time and have put it off. You fire up your windows testing environment and your worst nightmare has come true. The entire layout is blown out. Divs are strewn about like your tpl.php ate a hand grenade.
CSS: ur doin it wrong.
So I'm over on codinghorror reading a blog by one of the Stack Overflow guys about how CSS is super limited. Jeff hits us with a couple examples of how CSS falls short and then goes on to explore a couple Ruby gems that supposedly shine up the giant turds that are cascading stylesheets.
Jeff's 3 problems with CSS are:
- Vertical alignment is a giant, hacky PITA.
- Lack of variables so we have to repeat colors all over the place.
