ThemeShaper Forums » Thematic


Child theme and default.css

(9 posts)
  • Started 7 years ago by Jagst3r15
  • Latest reply from Jagst3r15
  • This topic is resolved
  1. Hi, so if I move the default.css from the Thematic folder to my Child Theme folder is that a bad thing? (I noticed that I could only make certain changes by altering the default.css file).

    Any thoughts?

    Posted 7 years ago #
  2. proto

    Hi Jagst3r15,

    You don't need to move the default.css file, it's definitely not recommended. If you're using a child theme all the default.css styles are automatically inherited as a starting point. Any changes you make to your child theme style.css file override the default.css. Of course, the advantage of a child theme when it comes to upgrading theme all your child theme styles are retained!

    I would suggest you read this on child themes:

    If you want to know a little more here's another useful link:

    In short, I would not move your default.css file. Develop a child theme. The default.css files are imported (see articles above) but when you change something in your child theme style.css file that is the one that takes precedence! There's no reason to move the default.css file.

    Hope the above helps, definitely worth reading and you'll see for yourself why it makes sense to use a child theme for so many reasons!

    Posted 7 years ago #
  3. I should have said that I know about Child Themes a little, as I am building my own - for example - but was not sure about which style sheet took precedence. I'll go ahead and restore the original default.css and paste only the altered portions of the default.css into the style.css (I think this is correct?) I am good with development of HTML and CSS in general, so don't be offended at my newbness -- I'm merely new to Thematic and developing WP Themes :-)

    Posted 7 years ago #
  4. proto

    Sure good luck with it all!

    Good to know you'll be using your child theme. You'll notice that your default.css file is imported as virtually the first lines of code in your child theme style.css file, along the lines of:

    /* Default css Stylesheets */
    @import url('../thematic/style.css');

    So yes modify things you want to change in your child theme style.css file - it does take precedence :) and is safe for upgrades.

    If you think your query has been answered please mark it as resolved at the top. There's some great people on here who have helped me a lot so I try and put back too!

    Posted 7 years ago #
  5. if you are going to be doing a lot of work, then i would recommend that you copy default.css into your child's style.css. actually, i'd recommend that you copy the other imported sheets too even if you don't make any changes to the reset, typography and image.css sheets.

    the reason i recommend this is that importing everything separately means that a browser has to load 4-5 css files instead of one. cutting down on those "round trips" will make your site a little leaner and meaner.

    i recommend doing something similar w/ all the javascripts too... (combining them i mean)... but that is more advanced, though i wrote something in the forum on it somewhere.

    Posted 7 years ago #
  6. and what about Theme Options...could I make a Theme Options admin panel for my users so that they could change that light blue color to whatever they want via an html code picker or something? Or is that impossible to do unless I make 500 different css files with different colors?

    Posted 7 years ago #
  7. proto

    Hell all,

    Obviously I'd go with Hegla's recommendations, she has a lot of experience and helped me out of many a scrape or two! From the above it sounds like you'd reduce load time by have one mega master css file? Assume once you've copied and pasted, default.css, reset.css etc, etc into your child theme css file there's no need to import them?

    Jagst3r15 - good luck with it all!

    Posted 7 years ago #
  8. right proto, copy them into style.css in the same order they were imported.. and then you have no need to import them. if you really wanted to reduce load, you'd combine the rules... but that's too much effort for me.

    theme options, i always go w/ devin price's options framework:

    then i'd add the php-dependent style rules directly to the header... something like:

    function kia_theme_option_css(){ ?>
    body {background: <?php echo of_get_option('background_color','#FFF'); ?>;
    <?php }
    Posted 7 years ago #
  9. thanks, i'll use that. hopefully it's not too hard to use

    Posted 7 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.