WordPress.org

Ready to get started?Download WordPress

Forums

Creating a child theme stylesheet (9 posts)

  1. jmcgil14
    Member
    Posted 3 years ago #

    If cretaing a child theme for twentyten do you need to use the @import rule or can you simply copy the contents of the original stylesheet into the style.css file contained within the child theme directory?

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    I'd suggest using @import.

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    what are your plans?

    If you want to use all/most of teh original css, use @import

    I decided I planned to overhaul quite a bit of the original css, so I copied it all over

  4. jmcgil14
    Member
    Posted 3 years ago #

    I have a visualisation that i need to follow so i will probably change quite a few things relating to layout, colour schemes etc, i know i will find it easier to change things if i have the whole file in front of me.. i just wanted to make sure copying everything over wont cause any issues?

  5. Chip Bennett
    Theme Review Admin
    Posted 3 years ago #

    You can do whatever you want, depending on your needs and circumstances.

    Child Themes work in two separate areas: the template hierarchy, and CSS.

    If you merely want to override the template hierarchy, then use @import in your stylesheet.

    If you want to make only minor changes to the style, then use @import.

    If you want to completely overhaul the style, then omit @import, and define the styles explicitly, either by copy-pasting from TwentyTen's style.css and modifying, or else starting your own style definitions from scratch.

  6. jmcgil14
    Member
    Posted 3 years ago #

    I think i will copy everything over and edit it from there, Thanks for all your help folks, really appreciate it! I do graphic/web design and decided to learn a completely new subject area i.e wordpress for my dissertation and its proving to be slightly harder than i anticipated!

  7. alisonius
    Member
    Posted 3 years ago #

    To piggyback on this thread-
    Since you mention "starting your own style definitions from scratch," I was wondering-- how do you recommend doing this within wordpress? I have been working on a new site, where I heavily modified the original css of the Twentyten theme. After reading more about WordPress, I tried to move these changes into my own child theme, so I wasn't altering the original css. I am coming up with a lot of problems, because instead of just being able to add and delete elements at will, now I have to make sure I address every element from the original theme.

    Is here anything so bad about altering the original stylesheet, as long as you keep a hard copy of the css in case WordPress updates? I prefer the freedom that this gives me, but as I am learning as I go, I don't want to get myself in a bind later by doing this. Thank you so much for any advice!

  8. ryanve
    Member
    Posted 3 years ago #

    Go with the child theme. If you don't want the predefined styles, then don't @import the parent's stylesheet. The main problem with editing parent themes themselves is that if the parent theme comes out with an update, then you either have to remake all your customizations, or choose not to update and thus not take advantage of any new versions. Read this.

  9. alisonius
    Member
    Posted 3 years ago #

    I don't have access to that link, but thank you for your reply, it helps a lot. My child theme was not properly activated, so that was why some of my changes weren't coming through. As long as I can create my own styles in the child theme by leaving out the @import, I am set! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic