I speak with literally hundreds of Flare users every month and one frustration that I hear over and over is about the strict nature of using CSS styles in an XML environment.

People are used to creating styles in an application like Microsoft Word and then being able to use those styles anywhere. Due to the strict nature of XML if you create a paragraph CSS style then it can only be used in paragraphs. If you create a list style then it can only be used in lists, and so on. This strict enforcement can be frustrating. You have a perfectly good style called p.MyStyle that makes text neon blue, italic, underlined, and with a lime green background (because that is soooo user friendly) and you want to apply this style to the second step in your procedure...but you can't. Since this is a paragraph style you can't use it in the list you are using to number your procedure steps.

At this point some folks would go on to create another style called li.MyStyle and go through all of the work to match the attributes of this new style to perfectly match the paragraph version. But, this is completely unecessary! What if I where to tell you that there was a way to create a single style in your Flare CSS Style Sheet that could be used on any element, anywhere in your topics, at any time?! Well, that is exactly what we are going to do.

Creating a Paragraph Class

  1. First, open Flare and open your active CSS file in the Flare style editor.
  2. Now, select the p element in the style sheet editor. We need to select it because we are going to make a new class attached to it.
  3. Once you have the p element selected, go to the toolbar and click on the "Add Class" option.
  4. Name the new class "Tip" and click OK. You will now have a new style class called p.Tip.
  5. Add some attributes to your new style class such as a background color, border lines, etc. Add the attributes so that you can definitely see a change when the style class is applied to text in your topics.

OK, now we have a standard paragraph style that can be applied to any paragraph in your project. But, try to apply this new tip style to text in a table, or in a list, or in any element that isn't a proper paragraph and poof, your nice new style disapears from the list of available styles. Now for the magic part!

Converting a Paragraph Class to a Generic Class

  1. OK, locate your CSS file in the Content Explorer view.
  2. Right click on your CSS file and select "Open with > Internal Text Editor"
  3. Now that you have access to the actual CSS code, scroll down to the bottom and find your style p.tip.
  4. Now for the magic part. Place your cursor in front of the p in the p.tip entry and....press the delete key. You want to delete the letter p and leave the .tip part.
  5. Save the edited CSS file by clicking on the save icon on the toolbar or pressing Ctrl-S.

You now have what is called a Generic Style. Open a topic in your project and place the cursor anywhere you want, in a table, in a list, in a paragraph, and no matter where you place your cursor you should now have access to your tip style.

This is a technique that can be used to make any style settings you create available at any time anywhere in your Flare project. The most important part is that this is all perfectly legal with regards to XML and CSS and won't cause any problems with your project.

Enjoy!