Stylesheet links in <head> output in wrong order since 2022

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
_[shapeonthewall]_
Propeller Head
Posts: 11
Joined: Tue Nov 19, 2019 9:01 am
Location: Scotland

Stylesheet links in <head> output in wrong order since 2022

Post by _[shapeonthewall]_ »

Context:
I recently upgraded from 2017r3 to 2022 and today performed the first build of the primary target - a HTML5 target (a help docs site). I then copied the output folder to a localhost folder and viewed the localhost in my browser. That's how I test the output before I publish it.

Problem:
So, my problem is that one of the stylesheets is being output in the wrong precedence order in the HTML. After a day of investigating and comparing it to the source code of the live project (the previous release), I have worked out part of the reason behind this, but have not worked out where this change came from. It wasn't me...! I wonder if any of you have experienced the same thing? I also wonder if it might be a bug.

Illustration:
The following shows you the <link rel="stylesheets"> output generated today by Flare 2022. (These are just the ones relevant to this problem) Note the position of xa_help_styles.css - it's first.

Code: Select all

        <link href="../resources/stylesheets/xa_help_styles.css" rel="stylesheet" type="text/css" />
        <link href="../resources/stylesheets/xa_mega_menu.css" rel="stylesheet" type="text/css" />
        <link href="../resources/stylesheets/xa_styles.css" rel="stylesheet" type="text/css" />
        <link href="../resources/stylesheets/scrollbar.css" rel="stylesheet" type="text/css" />
      
Okay, now look at the output on the live site. xa_help_styles.css is last. That's because it should be - it's meant to override the generic styles in xa_styles.css.

Code: Select all

       <link href="../resources/stylesheets/xa_mega_menu.css" rel="stylesheet" />
        <link href="../resources/stylesheets/xa_styles.css" rel="stylesheet" />
        <link href="../resources/stylesheets/scrollbar.css" rel="stylesheet" />
        <link href="../resources/stylesheets/cookieconsent.min.css" rel="stylesheet" />
        <link href="../resources/stylesheets/xa_help_styles.css" rel="stylesheet" />
So, xa_styles.css is associated with the layouts that are stored in 'master-pages'. Full path: Project/Content/resources/master-pages/
And, xa_help_styles.css is associated with the Project and the Primary Target.

Am I wrong, or is Flare v2022 treating the stylesheet attached to my master pages in /master-pages/page-layout-example.flmsp as if it were a local?

Is it the case that back in version 2017, the master-pages files '.flmsp' were granted lower precedence? What's going on?

I can fix this by simply adding the desired stylesheet to the master pages, but I'd like to know why this is now required in v2022.
Flare 2023 r2 bound to Azure DevOps TFS
_[shapeonthewall]_
Propeller Head
Posts: 11
Joined: Tue Nov 19, 2019 9:01 am
Location: Scotland

Re: Stylesheet links in <head> output in wrong order since 2

Post by _[shapeonthewall]_ »

Update: I've had confirmation from MadCap Support that from v2022, Flare treats CSS precedence differently than in earlier versions. Here's what was confirmed:
The precedence has changed to prioritize the local stylesheets associated with template pages over the primary stylesheets set in the Target and Project properties. Here is a link to our Online Help regarding Primary and Local Stylesheet Precedence for Output:
https://help.madcapsoftware.com/flare20 ... eforOutput
Flare 2023 r2 bound to Azure DevOps TFS
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Stylesheet links in <head> output in wrong order since 2

Post by NorthEast »

Thanks for sharing - I didn't know that'd changed, or that it was documented!
Post Reply