888888.888888.88""Yb..dP"Yb..8888b..Yb..dP.88b.88....db....8b....d8.88..dP""b8..dP"Y8
88__...88__...88__dP.dP...Yb..8I..Yb.YbdP..88Yb88...dPYb...88b..d88.88.dP...`".`Ybo."
88""...88""...88"Yb..Yb...dP..8I..dY..8P...88.Y88..dP__Yb..88YbdP88.88.Yb......o.`Y8b
88.....888888.88..Yb..YbodP..8888Y"..dP....88..Y8.dP""""Yb.88.YY.88.88..YboodP.8bodP'


88b.88.888888.888888.Yb........dP.dP"Yb..88""Yb.88..dP
88Yb88.88__.....88....Yb..db..dP.dP...Yb.88__dP.88odP.
88.Y88.88"".....88.....YbdPYbdP..Yb...dP.88"Yb..88"Yb.
88..Y8.888888...88......YP..YP....YbodP..88..Yb.88..Yb

January 14, 2008

CSS Banner

I’ve had a few comments recently from people using one of my plugins but having difficulties with the CSS. This is not so surprising because of the great variety of themes out there; however, it occurs to me that a set of standards for theme CSS might be useful for both themers and plugin authors.

If you take a look at the source code of of some blogs you may see five to ten entries for external CSS files, plus several style tags in the header itself, all of which will effect and potentially override each other.

The base CSS in the theme itself can render any one of those effectively inoperable depending on whether it uses ID attributes or classes, and how deeply it specifies the content.

There’s a nice, quick and easy, primer on CSS Specifity at HTML Dog and a slightly longer and more in depth piece at on specifity Smashing Magazine.

All this really means is that you can have two identical themes but, because of the CSS used, a plugin will work well on one, and work poorly on another, and the variety of themes means that it can be impossible to compensate for all of them successfully.

One possible solution to this is to try and set some standards; not an easy task, I know.

Take the standard layout, #header, #sidebar, #footer, #content. All using ID tags. They are an efficient way to go when building a theme but if you style #sidebar ul li ul li, you need to be at least that specific to override it. Knowing that it is how Kubrick does it means you probably style exactly that in the plugin in the hope that others copy it.

Now take that same plugin an put it in a different container, for example, #sidebar2 ul li ul li. The plugin probably won’t work now because the best you can do to in a plugin is be generic about the container (e.g. div ul li il li / ul.plugin li ul li) because you have no way to know what it will be called.

This isn’t a simple matter. To design CSS deliberately to avoid conflict and allow extension takes some thinking about.

What I want to know is how often has you installed a plugin and found that the CSS doesn’t work as expected? If you build themes do you already try and build it with this in mind? if you think there should be standards then what should those standards be? what is the best way to avoid conflicts? and finally do you think it is it even possible to set standards for something like this? Let me know.

Html 5 Gallery
Wordpress html5?
6 comments
page 1305
Quick N Dirty Admin Login Screen
Login screen css?
no comment
page 128
What Wordpress Workflow Needs
Word press workflow?
3 comments
page 1226
How To Add Sidebars To A Theme
Wordpress thematic modify sidebars?
10 comments
page 1053
Post Image The Easy Peasy Way
Wordpress theimage?
26 comments
page 1065
Six Million Ways To Die Choose One
Ways to die without noticing?
14 comments
page 1128
Using Your Own Url Shortener
Htaccess tiny url shortner?
4 comments
page 1190
Photoshop Design Framework
Photoshop framework?
3 comments
page 296
Creating Custom Urls
Custom url for wordpress page?
6 comments
page 80
How To Add Sidebars To A Theme
How to add a sidebar to a theme?
10 comments
page 1053
Photoshop Design Framework
Framework in photoshop?
3 comments
page 296
Html 5 Gallery
Wordpress html5?
6 comments
page 1305
Using Your Own Url Shortener
Build your own url shortener?
4 comments
page 1190
My Experience Of Flexx
Cant upload image to flexx wordpress theme?
4 comments
page 1026
Post Image The Easy Peasy Way
Wpget post image?
26 comments
page 1065
Post Image The Easy Peasy Way
Get postattachments?
26 comments
page 1065
What Wordpress Workflow Needs
Wordpress workflow?
3 comments
page 1226
Html 5 Gallery
Html5 plugin wordpress?
6 comments
page 1305
Questions About Habari For Wordpress Users
Habari or wordpress?
6 comments
page 424
Custom Hooks For Admin Pages
Wordpress post form admin pages?
one comment
page 430
3 Ways To Speed Up Your Blog Without A Cache Plugin
Wordpress cache disqus?
one comment
page 1321
Updating Code Snippets Here
Yb fun blogs?
no comment
page 1338
Html 5 Gallery
Html 5 photo gallery?
6 comments
page 1305
Html 5 Gallery
Html5 photo gallery?
6 comments
page 1305
Using Wordpress As A Php Framework
Using wordpress as a framework?
2 comments
page 335
Using Your Own Url Shortener
Rewriterule shorten url?
4 comments
page 1190
Post Image The Easy Peasy Way
Finding attached image with post in wordpress?
26 comments
page 1065
Wordpress 25 Exif Fields
Wordpress exif plugin?
12 comments
page 230
Post Image The Easy Peasy Way
Wp image attached linkable?
26 comments
page 1065
My Experience Of Flexx
How to edit flexx theme wordpress?
4 comments
page 1026
Post Image The Easy Peasy Way
List image attachments wordpress?
26 comments
page 1065
Html 5 Gallery
Html 5 photo gallery?
6 comments
page 1305
Post Image The Easy Peasy Way
Wp get first image for post?
26 comments
page 1065
  1 query every 1047 seconds, updated 1 seconds ago.
Post a comment?