Global or page styles do not apply to all pages

That’s somehow a follow up of my previous question (Page or Global CSS do not apply).

To visibly mark content or elements which are still in discussion on our staging entity, I gave those elements (rows, images, columns etc.) an additional custom class “attention”. At the global styles I styled this class like:

.attention {
  outline: 5px dashed red;
  z-index: 99999;
}

Everywhere - except for the homepage - this style is applied to elements with that custom class. Even when using “!important”.

To make it work on the homepage as well, I had to add the style to ../pro/framework/dist/css/stacks/integrity-light.css I noticed a lot of "outline: 0 !important"at that css which obviously overwrite my custom page or global css.

Is that intended?

I wonder how that can be because the inline styles are loaded after the integrity-light.css.

best regards
Mirco

PS: I’m aware that this change to the integrity-light.css will be gone after an update of the theme. :slight_smile: and even if it may work at a child theme, I need to remember to remove that style before going life :slight_smile:

Hello @mircotripoczky,

Thanks for writing in! Your custom CSS will not be applied to the element because of the CSS Specificity. Kindly check out this article for more information:

Cheers.

Hi @ruenel,

already thought so. Was just wondering, why it does apply on some pages but not on all. In my case it’s not applied to the homepage but on all other pages.

At least I found a way to get around it by adding my style to the integrity-light.css temporary. :slight_smile:

best regards
Mirco

Hi Mirco,

Glad that you were able to find a way. But we strongly discourage modifying the core file; instead, you can add this custom CSS code to Appearance > Customize > Additional CSS.

Thanks

Thanks @tristup

that’s indeed the best place to put this. I’m just most of the time within Cornerstone, that I forgot about this option :slight_smile:

best regards
Mirco

Hello Mirco,

Glad that we could assist you with your query.

Thanks

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