Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supercharge _s's stylability with some additional conditional body classes. #86

Closed
wants to merge 1 commit into from

Commits on Sep 22, 2012

  1. Added a handful of super-handy conditional body classes to super-char…

    …ge _s's stylability.
    
    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 :))
    brichards committed Sep 22, 2012
    Copy the full SHA
    2c14062 View commit details
    Browse the repository at this point in the history