WordPress.org

Ready to get started?Download WordPress

Forums

Cleaning up a theme (3 posts)

  1. LibraryMonk
    Member
    Posted 8 years ago #

    I'm working on a new theme at http://www.librarymonk.com/. It looks fine but the CSS is unnecessarily complex with lots of browser hacks etc. It's based on the Spirit theme http://www.bbiverson.com/spirit/

    I don't really care about all the browser hacks/corrections I'd like cleaner, easier to understand CSS, not perfection accross browsers.

    My CSS is here:

    http://www.librarymonk.com/wp-content/themes/monastery/style.css

    Can somebody take a look and tell me what I can safely remove? Or how I can get this same look with simpler CSS
    I'm afraid I'm not good enough with CSS to know what I can change in a file this complex.

  2. syncbox
    Member
    Posted 8 years ago #

    rather than approach it as what you can remove, just test each rule by commenting out the entire rule and looking through your site (all pages) to see if you see changes. I mean, some of it is obviously either cosmetic (in which case, you can pick and choose your own properties and values) and some of it is layout. If the author of the style sheet it worth his/her salt, they've organized the style sheet and commented it to make things clear.

    But everybody has different ways of working in css. Me, I am a minimalist class user... I only resort to classes if nothing else works and prefer to use ID'd regions and contextual selectors...eg.

    #sidebar ul {} or #footer p

    and I tend to rely heavily on inheritance, cascade and specificity. I detest seeing font-family repeated over and over, but hey, that's just me.

    Anyway, I am a beginner at WP and php, but am in the process of taking the default template and turning it into my own template, pretty much completely rewriting the style sheet, for sure. I don't much care for gigantic header.php layouts and find a lot of templates boringly the same.

    I hope to complete mine and share it with pride when done.

    D

  3. jabecker
    Member
    Posted 8 years ago #

    Another thing you can do is to put all of the browser hacks in a separate stylesheet and remove them from your style.css. Then import the hacks stylesheet in your header. That way they are out of the way but still available to the browsers that need them.

    Nice theme, by the way.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.