• I’m customizing andreas09 with a chld theme. This theme uses multiple css files (blue.css, for example) besides styles.css. I can’t seem to override these styles by putting a copy of them in my child theme. Is there something else I have to do?

Viewing 9 replies - 1 through 9 (of 9 total)
  • What order do these sheets load in?

    Thread Starter halfacre

    (@halfacre)

    I’m not sure, but I thought that identically named files in the child theme folder took precedence over those in the parent folder, which I guess would mean they load… um, last…? *smiles sheepishly*

    It appears that only one of these secondary sheets is called at a time, depending on your color choice in the theme options tab. I thought I’d leave it as blue.css and simply modify my child theme version of that file.

    I thought that identically named files in the child theme folder took precedence over those in the parent folder

    They do – usually. But .css files in sub-folders within the parent may not follow that rule. Can’t say I’ve ever tested this to find out.

    A better approach might be to import your child’s blue.css into the child’s style.css file if you really want to keep them separate. Or just add the rules from blue.css to style.css to reduce the number of http calls.

    Thread Starter halfacre

    (@halfacre)

    Hi esmi, thanks for the help.

    Well, that’s the funny thing – all these css files are on the top level of the parent.

    I also tried simply overriding the rule in styles.css, but no soap… the blue.css rule still took precedence.

    Your suggestion sounds reasonable, though. I’ll give it a shot real quick and let you know how it goes. I’d love to just slip the blue.css rules into styles.css, but I’m not sure how to keep from continuing to call blue.css afterwards.

    Are you using Firefox with Firebug to examine the cascade order of the various rules? It could be just a specificity issue.

    Thread Starter halfacre

    (@halfacre)

    Good point. Indeed, I am using FF and FB (which is how I knew my rule was losing to the blue.css rule), but what I’m not getting is *why* the blue.css rule is taking precedence. But then, I’m not yet a firebug power user – it may have more info to give me that I’m unaware of how to get. All I know is if I cancel the offending blue.css rule, my desired styles show up.

    I’m still downloading the whole wp install on my laptop, so when I’m through I’ll try your suggestions.

    The site is at https://www.rtdsmartcard.com if you feel like taking a peek and seeing if I’m missing the obvious. Thanks again!

    Where blue.css takes precedence appears to be in cases where the relevant rule or property doesn’t exist in style.css. eg:

    a {
        color: #0A8FBC;
    }

    blue.css (line 6)

    a {
        font-weight: bold;
        text-decoration: none;
    }

    style.css (line 32)

    Thread Starter halfacre

    (@halfacre)

    Hm… I even just took the whole of the css from blue.css, and brought in into styles.css and put it at the end, but still won’t override that blue.css style sheet. Tried this with or without importing the blue.css style sheet at the beginning of styles.css. This is weird.

    Thread Starter halfacre

    (@halfacre)

    I ended up just getting rid of the blue.css call in header.php (made a copy of this file in my child theme directory and removed the line that calls that sheet). That worked. Probably much cleaner this way anyway.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘override secondary style sheets in child theme’ is closed to new replies.