[Resolved] Child Theme CSS Precedence

Home Forums Support [Resolved] Child Theme CSS Precedence

Home Forums Support Child Theme CSS Precedence

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2440973
    Sam

    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

    #2440984
    David
    Staff
    Customer Support

    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 ?

    #2446644
    Sam

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

    #2446862
    David
    Staff
    Customer Support

    Glad to be of help!

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