Site logo

Archived topic

Child Theme CSS Precedence

3 replies · Started by Sam on November 29, 2022

Viewing posts 1–4 of 4

Hi,

I'm adding a lot of CSS to the stylesheet file of the GP child theme.

Most of the time, my CSS doesn't overwrite the theme's CSS.

How can I make my custom CSS file take precedence over the pre-existing CSS and overwrite it without resorting to twisted techniques such as "!important" or the wp customizer?

Thanks

Hi there,

the generate-child-styles loads after the parent theme stylesheet so as long as you use the same or more specific selectors in your child styles then there should be no issue.

Are there any specific rules you're having issues with ?

Thanks David,
I followed your advice, adding more specific selector.

Glad to be of help!

This archived topic is closed to new replies.