Wrong order of styles loading when turning off theme styles
-
I wanted to remove the big list of inline theme styles from my source code. So I checked the ‘Don’t load popup theme styles to the head’ setting.
This removed the inline CSS just fine.
Then I added the ‘Light Box’ theme CSS into my child theme style.css. Then the popup didn’t look right. Quite a few styles (not all of them) were missing.
After a couple of hours of detective work, I’ve found out why.
WITH your styles in place – this is the order the styles load in <head>:
1. Popup Maker main plugin CSS
2. My child theme CSS
3. Popup Maker inline theme stylesWITHOUT your styles (checking the box):
1. My child theme CSS
2. Popup Maker main plugin CSSSo when I turn off your theme styles, your default CSS is now overriding my copied ‘Light Box’ theme CSS. Previously, my child theme styles came AFTER yours, so they weren’t being overridden.
I’ve tried to figure out how to change the order. I need to load your main CSS BEFORE my child theme CSS, just like it does by default. But I just can’t work out how to do it.
I’ve temporarily solved the problem by placing my custom styles inline in the footer of the site. At least that way, they 100% for certain load after your main styles. ?? But it’s not a good solution.
Can you help?
- The topic ‘Wrong order of styles loading when turning off theme styles’ is closed to new replies.