Bright Bacon - css http://brightbacon.com/taxonomy/term/348/0 en Knowing Your Body and Practicing Safe CSS http://brightbacon.com/blog/drupal/knowing-your-body-and-practicing-safe-css <div class="field field-type-filefield field-field-blog-image"> <div class="field-items"> <div class="field-item odd"> <img class="imagefield imagefield-field_blog_image" width="260" height="194" alt="" src="http://brightbacon.com/sites/default/files/blog_images/safe-css.jpg?1327605924" /> </div> </div> </div> <p>This is a quick trick I picked up to guarantee that any css changes you make only affect what you want.</p> <p>There are different ways to identify the page you need to change. I tend to use url as it's always unique.<br /> Here's how:<br /> Locate the template.php file for the theme your working on and add something like this to the page_preprocess function<br /> <div class="geshifilter"><div class="php geshifilter-php" style="font-family:monospace;"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #000000; font-weight: bold;">function</span> your_theme_preprocess_page<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$vars</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></div></li> <li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #666666; font-style: italic;">// Add a custom body class for specifc page</span></div></li> <li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'q'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'example/page/new-body-class'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></div></li> <li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; <span style="color: #000088;">$vars</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'body_classes'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">' custom-body-class-name '</span><span style="color: #339933;">;</span></div></li> <li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"><span style="color: #009900;">&#125;</span></div></li> </ol></div></div></p> <div class="field field-type-number-integer field-field-blog-featured"> <div class="field-items"> <div class="field-item odd"> off </div> </div> </div> <p><a href="http://brightbacon.com/blog/drupal/knowing-your-body-and-practicing-safe-css" target="_blank">read more</a></p> Drupal body classes css Drupal how to theming Thu, 26 Jan 2012 19:52:23 +0000 erik 42 at http://brightbacon.com IE Blew Up My Layout!!! http://brightbacon.com/blog/drupal/ie-blew-my-layout <div class="field field-type-filefield field-field-blog-image"> <div class="field-items"> <div class="field-item odd"> <img class="imagefield imagefield-field_blog_image" width="300" height="309" alt="" src="http://brightbacon.com/sites/default/files/blog_images/ie8_rc.jpg?1314314927" /> </div> </div> </div> <p>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.</p> <div class="field field-type-number-integer field-field-blog-featured"> <div class="field-items"> <div class="field-item odd"> off </div> </div> </div> <p><a href="http://brightbacon.com/blog/drupal/ie-blew-my-layout" target="_blank">read more</a></p> http://brightbacon.com/blog/drupal/ie-blew-my-layout#comments Drupal css Firefox HTML IE theming Thu, 25 Aug 2011 23:29:13 +0000 erik 41 at http://brightbacon.com CSS: ur doin it wrong. http://brightbacon.com/blog/drupal/css-ur-doin-it-wrong <div class="field field-type-filefield field-field-blog-image"> <div class="field-items"> <div class="field-item odd"> <img class="imagefield imagefield-field_blog_image" width="450" height="297" alt="" src="http://brightbacon.com/sites/default/files/blog_images/css-layouts.gif?1274820216" /> </div> </div> </div> <p>So I'm over on codinghorror reading a blog by one of the Stack Overflow guys about <a href="http://www.codinghorror.com/blog/2010/04/whats-wrong-with-css.html" rel="nofollow">how CSS is super limited</a>. 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.</p> <p>Jeff's 3 problems with CSS are:</p> <ol> <li>Vertical alignment is a giant, hacky PITA.</li> <li>Lack of variables so we have to repeat colors all over the place.</li> </ol><p><a href="http://brightbacon.com/blog/drupal/css-ur-doin-it-wrong" target="_blank">read more</a></p> http://brightbacon.com/blog/drupal/css-ur-doin-it-wrong#comments Drupal aqua color border color Cascading Style Sheets Computing content navigation couple examples css css example css2 example header footer fundamental misunderstanding gems giant turds inheritance one at a time radius Ruby shade cross-site stack overflow true god variables vertical alignment Web design webkit Tue, 25 May 2010 20:43:40 +0000 Domenic 24 at http://brightbacon.com