Automattic/_s — pull request #86 by brichards (2012-09-22 17:08:08+00:00)
Title: Supercharge _s's stylability with some additional conditional body classes.

Over the years I've found the conditional browser classes to be indespensible in theme development. When a particular browser is misbehaving it is extremely simple to conditionally alter a style (or fire some javascript) to handle its minor inconsistencies without having to load entirely separate stylesheets or conditional script files.

The post-/page-slug conditionals has also made it very easy to style a specific page/post on a dev server and have all the styles automatically match in production (in cases where a strict database export/import isn't used and post IDs change). It also makes it easier to read and write styles because a slug is more easily recognized than an arbitrary ID.

The category classes of course make it easier to style a site that uses thematically different categories (magazine style) and the date-based classes just allow for fun things like styling a site differently for Christmas or styling posts published in January in a way that separates them from posts published in otther times of the year.

The date-based classes require an additional function (_s_date_classes()). This functionality is probably superfluous for most sites, but is still a pretty clever trick and demo. Hat-tip to Ian and Themeatic for the inspiration behind this one… i think :)