Hello everyone,
I am looking for a way to set up a condition (preferably in my Master Page) to tell Flare when to load a certain stylesheet.
In my project structure, I have a Master project with one main css that is used for all projects in all languages, and three smaller css that contain language-specific styling. I have assigned condition tags to these language css and they are inherited by child projects via Global Project Linking, depending on which condition was configured in the import file.
The import of the file itself works fine. BUT in my master page, I also have to have a <link> tag that will load the css during the build. And this is where I need the condition.
If I enter three <link>s in my Master Page, one for each language stylesheet, two of them will of course return a "file not found", because of the condition set in my import file.
Is there any way to tell Flare something like
if language = "German" then link Stylesheet_DE.css
if language = "English" then link Stylesheet_EN.css
I have tried using a script to append the <link> tag and deleted it from the Master Page, but the stylesheet is then not included into the output folder during the build process. It seems that Flare needs a static information on which stylesheet to use.
Any help would be much appreciated!
Thanks,
Agnieszka
Conditional Linking of Stylesheets
Re: Conditional Linking of Stylesheets
I think an easier way to do this will be to use the CSS :lang() pseudo class.
For example, say you had a note style p.note that inserted some text, like this:
If you wanted to display different text for English and French, then you could use the :lang pseudo class in your CSS to specify the language:
See: https://developer.mozilla.org/en-US/docs/Web/CSS/:lang
For example, say you had a note style p.note that inserted some text, like this:
Code: Select all
p.note:before
{
content: "English: ";
}
Code: Select all
:lang(en) p.note:before
{
content: "English: ";
}
:lang(fr) p.note:before
{
content: "Francais: ";
}
Re: Conditional Linking of Stylesheets
Thank you! That's much easier and more elegant then trying to do something with a script.
And it worked
And it worked
Re: Conditional Linking of Stylesheets
Hello Agnieszka, hello Dave!
Mark
Dave Lee wrote:I think an easier way to do this will be to use the CSS :lang() pseudo class.
Could it be that this only works with specific target types? I'm using a PDF target and the language pseudo class in the CSS seems to be ignored. I've also tried different language codes (short, long incl. country code). Or is there any other place (besides the global project language setting) where I need to include some extra language indication?OS_Loc wrote:Thank you! That's much easier and more elegant then trying to do something with a script.
And it worked
Mark