Remove the need for "move generated css" when using a child theme

  • lenw

    #5638

    Suggest a change to remove the “move generated css” in Graphene options, this is really messy and means that for any further change in Graphene options, the code needs to be re-copied into the child style sheet file.

    I thought that the style.css of the child theme is applied after the style.css of the parent theme, and that the Graphene options setting are updating the Graphene style.css directly.

    So why do we get a huge chunk of css code in each page (duplicated from teh style.css) which then needs to be copied into the child theme style.css file?

    I have a child theme to keep specific css separate, and include additional code in functions.php.

    LenW

    Admin

    Syahir Hakim

    #32174
    Quote:
    Suggest a change to remove the “move generated css” in Graphene options, this is really messy and means that for any further change in Graphene options, the code needs to be re-copied into the child style sheet file.

    Which is why you should only do it when you’re not expecting any frequent changes to your site’s style anymore.

    Quote:
    I thought that the style.css of the child theme is applied after the style.css of the parent theme, and that the Graphene options setting are updating the Graphene style.css directly.

    Yes, the theme’s styles are loaded first before the child theme’s styles, but the Graphene Options setting do not update the theme’s style.css file directly. This is due to several issues, one of which is the myriad of different file permissions on different servers that may not allow for modifying file directly. There’s also the security risk of allowing a theme to write a file on the server (less so in a VPS, but think about shared server).

    In most cases, the amount of additional CSS added to the page is inconsequential to the load time of the page, as they represent a very small portion of a page’s byte size (and since they are plain text, they are highly compressible as well). So it’s not worth it to do all the dances to take care of different server settings and the security risks of writing the changes directly into a file. Plus it’ll make saving the options page longer, and add another IO operation to your server.

    Quote:
    So why do we get a huge chunk of css code in each page (duplicated from teh style.css) which then needs to be copied into the child theme style.css file?

    You don’t have to. All the settings work fine without you having to copy the CSS codes into your child theme. This is just for those edge cases where people have been using all of the colour options and adding lots of CSS codes into the Custom CSS option.

    Quote:
    I have a child theme to keep specific css separate, and include additional code in functions.php.

    As it should be.

    lenw

    #32179

    Syahir, thanks for the comprehensive reply.

    Relating to your comment about copying the css code into the child theme:

    Quote:
    “You don’t have to. All the settings work fine without you having to copy the CSS codes into your child theme. This is just for those edge cases where people have been using all of the colour options and adding lots of CSS codes into the Custom CSS option.”

    I have changed quite a lot of the colours in the orange colour scheme.

    I have also added quite a lot of additional css which is now in the child style.css, instead of in the Display, Custom CSS section.

    So if I have understood correctly, leave the css code block on each page until the site is ready for live running, then when all the configuration is agreed then copy out to the child style.css.

    LenW

    Admin

    Syahir Hakim

    #32180
    Quote:
    So if I have understood correctly, leave the css code block on each page until the site is ready for live running, then when all the configuration is agreed then copy out to the child style.css.

    That is correct.

    But you can still leave all the settings as they are, even the codes in the Custom CSS feature. The theme just won’t add those codes into the page anymore if you’ve ticked the option that you’ve copied them into the child’s style.css.

Viewing 4 posts - 1 through 4 (of 4 total)

  • You must be logged in to reply to this topic.