WordPress.org

Ready to get started?Download WordPress

Forums

Child theme cascading, editor theme importing (3 posts)

  1. morgannunan
    Member
    Posted 4 years ago #

    Hi,

    I have two questions about the way WordPress theme css borrows styles.

    1. When using a child theme, do all the new styles just cascade on top of the old ones? Meaning: say my p tags color the text red in the parent, blue in the child. Does wordpress get the parent theme, color all the paragraphs red, then get the child and then color them blue, or do the new styles completely overwrite the old ones the way templates and functions do?
    2. Can I just @import styles from my stylesheet into this new editor-style.css? I would rather not declare all these things twice. What happens if I have to make a series of changes to my stylesheet? I have to then copy these lines into editor-style.css?

    Thanks.

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    do all the new styles just cascade on top of the old ones?

    No - not unless you import them into the child theme. The child's style.css overrides the style.css of the parent.

    Can I just @import styles from my stylesheet into this new editor-style.css?

    Yes - in theory, I've not played with child editor styles yet.

    Have you reviewed Child_Themes?

  3. morgannunan
    Member
    Posted 4 years ago #

    I did look through the codex, yes. I just tested a child theme on my end and from firebug it does look like it just cascades styles over the parent styles. This could be problematic because I could see a child theme becoming like a css-hacked thread on a forum, or a myspace page, where the base loads and then all this other stuff comes up mid-load. Maybe it's different if everything is loading from the head, though? It's still loading all those extra styles for no reason...

Topic Closed

This topic has been closed to new replies.

About this Topic