• Resolved BetsyS

    (@betsys)


    I’m using TwentyEleven child theme, just beginning to build my website. So far, the style sheet in the child directory just has a couple things in it, tagged with !important.

    Would it be better and cleaner if I just copy the entire parent theme stylesheet into my child directory, and make changes to it as one unit, rather than a bunch of patchwork !important bits and pieces? I was intimidated by the entire parent theme stylesheet at first, because it’s so huge – but now I can’t figure out which approach is preferable.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The best thing to do is to just copy over what you need.

    I’m sure you already have it set up with the @import rule calling to twentyeleven.

    So now, you just copy over the things you need to modify only, and make your changes in the child theme.

    You should not need the !important rules, child theme style.css takes precedence over the parent theme

    No need to copy over the whole stylesheet and cause clutter. Just copy over the rules you wish to modify (or write entirely new rules)

    One of the best practices regarding Child Themes is only ever copy into the Child Theme that which you intend to modify. This practice holds for template files, functions, and CSS styles.

    So, @rev. Voodoo is exactly right: only copy into the Child Theme’s style.css file the CSS declarations you intend to override.

    You’ll save yourself many headaches later.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is it better to copy whole stylesheet into child theme?’ is closed to new replies.