1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Resolved Bug Reports' started by Floren, May 13, 2014.

  1. Floren

    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.jpg

    Bad:

    css-bad.jpg

    Thank you for your help.
     
    Last edited: May 13, 2014
  2. Mike

    Mike XenForo Developer Staff Member

    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.
     
    Floren and Chris D like this.
  3. Floren

    Floren Well-Known Member

    Thanks Mike for taking the time to explain, that is what I ended-up doing related to selector.
     

Share This Page