Styled variables

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Dafra08
Propeller Head
Posts: 45
Joined: Fri Aug 16, 2019 1:02 am

Styled variables

Post by Dafra08 »

Yipee! ... Almost :(

Please tell me that any of you CSS wizards know how to apply a variable style class to an entire variable set. I have read the documentation, experimented back and forth, haven't succeeded. But I am quite confident I am missing something here.

Otherwise I don't really see the point with the new variable styling feature. Creating a class for every single variable is quite useless, since, as MadCap themselves point out, you can also apply a generic class to variables. Of course the variables are styled automatically if you add them, but since you have to create them one by one the effort is probably the same as using a generic class if you want to style more than 5-10 variables... Not to mention that the stylesheet will be totally cluttered.

My use case: I use bold for user interface references, which are variables. I create new variable sets from our code with every release, so those variable sets will only contain UI terms. I had really longed for this feature, and would have loved to create one variable style class, UI, and apply it to those variable sets. (On a side note, the generic class I have used for these variables up until now is actually broken after updating to 2020r2, so I have some searching and replacing to do...)
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Styled variables

Post by NorthEast »

This will work for HTML5 (but not PDF):

Code: Select all

MadCap|variable[class*='VariableSet.']
{
	color: #ff00ff;
}
Replace VariableSet with the class name of your variable set. This is case sensitive and based on the variable set filename.

If you're not sure what it is, define a style for an individual variable, then check the CSS in the text editor which is in this format:

Code: Select all

MadCap|variable.VariableSet\00002EVariableName
{
	
}
Dafra08
Propeller Head
Posts: 45
Joined: Fri Aug 16, 2019 1:02 am

Re: Styled variables

Post by Dafra08 »

Thank you, thank you, thank you for the extremely quick response! Works like a charm. And gives the exact functionality I was after.

For the record: The formatting is not visible in the XML editor, but shows in the preview and in the output.
RStreets
Propeller Head
Posts: 63
Joined: Wed Apr 19, 2017 8:37 am
Location: Cambridge, UK

Re: Styled variables

Post by RStreets »

This is excellent! I needed this for exactly the same purpose as Dafra08.
Thank you, Dave!
Rae Streets (Flare user since 2017, now on Flare 2023; Central user from 2020)
Post Reply