[documentation] Request: Drupal Stylesheet Guidelines
Adrian Simmons
adrinux at perlucida.com
Tue Jul 11 09:19:39 UTC 2006
Christian Berg wrote:
> My first thought was that i should add a new "Use of Stylesheets" Page
> in the "Drupal Coding Stadards" Book
Probably not a bad idea :)
> 2.) Modules should prefix their css classes to prevent collisions.
> for example: <div class="foo_listheader"></div>
This suggestion keeps coming up, particularly from the programmer type
people, but it's really just unnecessary bloat. For most modules simply
wrapping module output in a container with class="modulename" will suffice.
> 3.) .css files should start with /* $id */
I believe that's already suggested in the coding guidlines, though
personally I hate the clutter...
> 4.) If Drupal gets an identing rule, we also should apply this for CSS.
Er...what? Use the same ID's thoughout? It'ss already used, but worth
documenting.
> 5.) Naming Convention: Strictly lowercase, words seperated with _
There is already a convention of lower case words with - as a seperator.
Historically _ was invalid in CSS class and ID names unless it was escaped
\_, only in 2001 with the errata to the CSS2 spec were underscores allowed.
We may have now reached a point where the older browsers that didn't support
_ are barely visible on the web, but we already have a convention of using -
to separate words in css classes and ID's, so let's not mess with it.
http://devedge-temp.mozilla.org/viewsource/2001/css-underscores/
http://wellstyled.com/css-underscore-hack.html
--
Adrian Simmons (aka adrinux) <http://adrinux.perlucida.com>
e-mail <mailto:adrinux at perlucida.com>
More information about the documentation
mailing list