[Support request] Aggregating CSS files with Autoptimize is overwriting my custom CSS

Home Forums Support [Support request] Aggregating CSS files with Autoptimize is overwriting my custom CSS

Home Forums Support Aggregating CSS files with Autoptimize is overwriting my custom CSS

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2359632
    Eugene

    Hi there

    I am currently wondering why the option “Aggregate CSS-files?” Autoptimise is causing my custom CSS in /wp-content/themes/generatepress_child/assets/css/style.css to be overwritten by the default GP CSS?

    I am suspecting that the default CSS loaded by GP in the <head> section is being prioritised over my custom CSS. See screenshot: https://prnt.sc/IQrXmZRnuzne

    However, I might be wrong and this is due to something else. Can you guys shed some light here? Ideally, I would like my custom CSS to take preference when the CSS is aggregated

    #2360019
    Ying
    Staff
    Customer Support

    Hi there,

    The best way to ensure your custom CSS is loaded after all other CSS is to add the CSS to customizer > additional CSS.

    Or use more specific selectors, for example, if the parent theme is using .slideout-overlay, then you can use .offside-js--is-open .slideout-overlay to ensure the overriding.

    #2360054
    Eugene

    Hi there Ying

    Thanks for your response. I’m wondering if there’s perhaps an alternative to that?

    We use scss and the CSS file is quite large and we would ideally want to have version control on the child theme and the styles.

    It wouldn’t be ideal for us to do this whole process according to our gir dev practises and update the additional css in customizer each time.

    We also make use of this custom css to edit most default classes provided by GP such as the main navigation and footer.

    Furthermore, i just want to make clear that this does not happen when we do not aggregate the css, then all is fine.

    Would appreciate your feedback on this

    #2360721
    Ying
    Staff
    Customer Support

    Furthermore, i just want to make clear that this does not happen when we do not aggregate the css, then all is fine.

    If that’s the case, it will be better to reach out to the plugin’s support.

    As if this only happens when the setting in the plugin’s activated, then it’s not something the theme can control.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.