Root variables with fonts

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Matze
Sr. Propeller Head
Posts: 177
Joined: Mon Jun 20, 2016 10:35 pm

Root variables with fonts

Post by Matze »

Hi all,
I´ve added font variables to my existing root color variables, but the font variables do not work. Are font variables not allowed in the root? Or is there something strange with the font-family line in the body section?

:root
{
/* Farben */
--White: #ffffff;
--Black: #000000;
--Hellgrau: #e1e1e1;
/* Flächen */
--Dunkelgrau: #2a373d;
/* Skin GN/MG */
--MouseHover: #e1e1e1;
--Orange: #e68b0c;
/* h1 und Links */
/* Schriften */
--Bold: 'UnitPro Bold';
--Medium: 'UnitPro Medium';
--Regular: 'UnitPro Regular';
--Light: 'UnitPro Light';

}

html /* Abstände Topic-Frame */
{
font-size: 16px;
margin: 10px 10px 10px 20px;
}


body
{
font-family: 'UnitPro Regular', 'Segoe UI', 'sans-serif';
mc-hyphenate: never;
text-align: left;
font-style: normal;
font-variant: normal;
text-transform: none;
margin-bottom: 1.9rem;
font-weight: 400;
}



h1
{
font-weight: 300;
font-size: 1.9rem;
margin-bottom: 0.8rem;
margin-top: 0.9rem;
color: var(--Black);
font-family: var(--Bold);

}
Psider
Propellus Maximus
Posts: 902
Joined: Wed Jul 06, 2011 1:32 am

Re: Root variables with fonts

Post by Psider »

My quick test with Comic Sans MS worked.

The other thing is, are you using the name you defined in your @font-face definition? If you haven't configured that name, then it won't work.

Similarly if you haven't defined @font-face, but are relying on the font names you can see in the Font dropdown, then things won't necessarily work. For example, I can see "Copperplate Gothic Bold" in the font list, but that doesn't work when I specify it. Instead, If I use the name that appears in the Fonts dialog in Window Settings, "Copperplate Gothic", then the correct font displays. (but you will have to specify the font-weight in your style as well.)

As a side note, if you are going to publish to a web server, relying on the fonts that are installed on your local computer almost certainly won't work unless you choose web safe fonts such as Arial.
Matze
Sr. Propeller Head
Posts: 177
Joined: Mon Jun 20, 2016 10:35 pm

Re: Root variables with fonts

Post by Matze »

I have clarified with the flare support colleagues to re-install my fonts for "all users" in admin mode. Now my variable font settings are working fine. Then I´ve checked the variable font names which are displayed in the text editor view it is working now :mimic:

But I´ve only used the font variables in @media print. For the html5 manual I only use font-weight with 300, 400, 500, 600 instead of light to bold.
Post Reply