One Project, Many Stylesheets?

This forum is for Single-Sourcing your Flare content to multiple outputs.

One Project, Many Stylesheets?

Postby hah81 on Thu Apr 06, 2017 3:30 pm

Hi,

I am trying to figure out if there's a way to have one project produce multiple HTML5 outputs with different styles.

NOTE: Probably worth mentioning I'm fairly new to Flare and not experienced with many intermediate-to-advanced stylesheet concepts and techniques, so I apologize if there's a solution out there staring me in the face.

PROBLEM
I create custom help sites for resell partners. I currently maintain three projects (one for each partner-branded site) with roughly the same content; the only differences are the org name and color scheme. While single sourcing the text is easy, I can't determine how to generate output styled for each partner--and thus avoid having to maintain multiple projects in parallel--since each site currently references two stylesheets (one for the homepage, the other for topics). The Target Editor appears to only let you specify one stylesheet (i.e., the Master Stylesheet) per build (though I admit I might not be following how Flare applies stylesheets during builds).

ON THE RIGHT TRACK?
One idea I had is combining the homepage and topic stylesheets into one file (per partner) and select that as the Master Stylesheet in the Target Editor.

Hope this makes sense. Any feedback is much appreciated!
hah81
Jr. Propeller Head
 
Posts: 4
Joined: Mon Mar 27, 2017 7:16 am

Re: One Project, Many Stylesheets?

Postby Dave Lee on Fri Apr 07, 2017 12:20 am

You can have as many stylesheets as you want - I use about 10 in my projects!

There are several ways to link to a stylesheet - you can have stylesheet links in a topic (e.g. for a home page), have stylesheet links in a master page, and have a master stylesheet set in the target.
Note that if you set a master stylesheet in the target, it will ignore any links to any other stylesheets in topics and master pages, unless you select the Allow local stylesheets option.

You can also use mediums, which allow you to have variations in styles between targets.

There are many ways to do this, but I'll just suggest two:

(A) Use mediums.
Create a medium for each target, with the styles that are specific for each target.

For example, TargetA has red headings, and TargetB has blue headings.

Code: Select all
@media TargetA
{
   h1 { color: red; }
}

@media TargetB
{
   h1 { color: blue; }
}


Then on each target's Advanced tab, select the medium to use for that target.

(B) Have a separate stylesheet for each target, but use an @import to include styles from your main stylesheet.

For example, target A could have a stylesheet TargetA.css which contains:
Code: Select all
@import url('your_main_stylesheet.css');
 /* Styles for target A go here */
h1 { color: red; }


Target B would have a stylesheet TargetB.css which contains:
Code: Select all
@import url('your_main_stylesheet.css');
 /* Styles for target B go here */
h1 { color: blue; }


Each target would have its master stylesheet set - e.g. TargetA.css, TargetB.css.
Your home page presumably has its own styles which you don't want to use in all topics, so you'd include that stylesheet link in the home page topic itself (and remember to select Allow local stylesheets).
Dave Lee
Master Propellus Maximus
 
Posts: 5657
Joined: Mon Mar 05, 2007 8:33 am
Location: UK

Re: One Project, Many Stylesheets?

Postby hah81 on Fri Apr 07, 2017 6:59 am

Wow, thank you, Dave! Such great info. I will investigate.
hah81
Jr. Propeller Head
 
Posts: 4
Joined: Mon Mar 27, 2017 7:16 am

Re: One Project, Many Stylesheets?

Postby hah81 on Fri Apr 07, 2017 9:31 am

One other thing I just thought of related to presentation--can you do something similar and use multiple skins in one project? For example, I use the default "HTML 5 - Top Navigation" skin for my outputs. It includes a placeholder for a company logo, which I switch out for each site. Can I just create skins for each site (e.g., "company1.flskn" and "company2.flskn"), then reference whichever one for the site I'm building in the Target Editor?

(Sorry I didn't include this in my original post--only been using Flare for a couple months :D).
hah81
Jr. Propeller Head
 
Posts: 4
Joined: Mon Mar 27, 2017 7:16 am

Re: One Project, Many Stylesheets?

Postby Dave Lee on Tue Apr 11, 2017 11:57 pm

hah81 wrote:One other thing I just thought of related to presentation--can you do something similar and use multiple skins in one project? For example, I use the default "HTML 5 - Top Navigation" skin for my outputs. It includes a placeholder for a company logo, which I switch out for each site. Can I just create skins for each site (e.g., "company1.flskn" and "company2.flskn"), then reference whichever one for the site I'm building in the Target Editor?

(Sorry I didn't include this in my original post--only been using Flare for a couple months :D).


Yes, you can set a different skin for each target.
Dave Lee
Master Propellus Maximus
 
Posts: 5657
Joined: Mon Mar 05, 2007 8:33 am
Location: UK


Return to Single-Sourcing

Who is online

Users browsing this forum: No registered users and 2 guests