How CSS styling can be inherited from style.css in child theme

Hello,
I use child theme and integrity stack on my web.
It seems every time I add a new button it comes with default customizations, it’s white, with rounded borders and with box shadow. When I insert a Classic Button then it appears with the customizations I chose in Theme Options -> Button and those applied in style.css for child theme.
How can this be synchronized so that when I choose a button (not classic) I directly get the inherited styling from somewhere? or do I have to use preset for every single button I add?
I would like the new buttons behave like in style.css without having to create Presets, is it possible?

This is the code for the button in style.css

.x-btn, .button, [type=“submit”] {
text-shadow: none !important;
border-style: solid;
border-width: 3px;
}

Thank you
Gabriela

Hello Gabriela,

Thanks for writing in!

It is best that you understand the hierarchy of the styles to know why your changes do not work. The styles were loaded in this order:

  • Theme’s stack style.css
  • Child theme’s style.css
  • WordPress Custom CSS (Appearance > Customizer > Additional CSS)
  • X Theme Options custom css
  • Cornerstone’s page custom css

If you want to force the styles you added in the child theme, you can make use of this code instead:

.x-child-theme-active .x-btn, 
.x-child-theme-active .button, 
.x-child-theme-active [type="submit"] {
  text-shadow: none !important;
  border-style: solid;
  border-width: 3px;
}

We would loved to know if this has work for you. Thank you.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.