Not a bug $_cssRequested array not respecting the order of templates

Floren

Well-known member
Edit: I posted the fix details I used.

I was faced recently with a CSS bug I explained in this thread, the template loading order is not respected:
Code:
<xen:require css="message_simple.css" />
<xen:require css="bb_code.css" />
<xen:require css="article_view_header.css" />
<xen:require css="article_update.css" />

@Mike or @Kier, what suggestion do you have to solve this problem? I would not consider this as bug but I really don't know how to approach it. Can you please explain to me where exactly the issue is? Is there a way to fix this programmatically? For now, I will add the !important condition into CSS. Below it is a more detailed output of the problem, note the padding and margin-top CSS.

Good:

css-good.webp

Bad:

css-bad.webp

Thank you for your help.
 
Last edited:
The required CSS files are loaded alphabetically. This is a big deal for caching, but it also provides consistency.

If you are having an issue with CSS application, you should either use a higher specificity selector or apply your changes within the dependent CSS template to guarantee a selector order.
 
Top Bottom