Combine multiple heading selectors to control color?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Phlawm53
Sr. Propeller Head
Posts: 442
Joined: Tue Mar 16, 2010 10:58 am
Location: San Francisco, CA
Contact:

Combine multiple heading selectors to control color?

Post by Phlawm53 »

My question centers on whether combining a particular sort of element definition will break or annoy Flare 6 and so needs to be avoided.

Because my document set's headings are all the same color, I want to know if it's "safe" in Flare to hand-edit the stylesheet CSS and:

1. In the CSS file, delete the color: [colorSpec]; element definition from all separately specified heading styles, where colorSpec is a valid color definition.

2. Add h1, h2, h3, h4, h5, h6 { color: [colorSpec];}.

The objective is to enable me to control the color of all headings in one place rather than in multiple, individual places.

Combining element definitions in this way is a valid "non-Flare" CSS approach, but as a new user of Flare 6 I want to make sure I'm not going to be too clever for my own good.

Cheers & thanks,
Riley
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Combine multiple heading selectors to control color?

Post by LTinker68 »

It's not that it's invalid in Flare, it's just that there's no way via the Stylesheet Editor to code like that. If you open the stylesheet file in the Internal Text Editor, then you can make that type of manual modification to the stylesheet code. The only things Flare doesn't like in the stylesheet code (although I haven't verified if they're still a problem in v6) are comments and wildcard characters.

The other downside is that if you later decide to add or modify the styles for that combined block, then you'll again need to open the stylesheet file and manually make the changes. If you make a change to h3 in the Stylesheet Editor, for example, then you'd have a separate h3 code block in addition to the combined code block. So you could have something like:

Code: Select all

h1, h2, h3, h4, h5, h6
{
    color: #000000;
}

h3
{
    color: #FF0000;
}
Which is valid code, but could still be confusing if you forgot that you had a combined block of styles. (Color is a bad example since you can easily see the difference, but if it were something like margins or padding then it may throw you off.)
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Combine multiple heading selectors to control color?

Post by Andrew »

I don't do much combining styles, but I do a lot of complex selectors in a text editor instead of using Flare's GUI editor, and I've never had a problem. As Lisa noted, you simply can't edit a lot of the more complex CSS stuff in Flare's editor. Since it's trivial to use something like Notepad++ instead of Flare's editor, I've never cared.
Flare v6.1 | Capture 4.0.0
Phlawm53
Sr. Propeller Head
Posts: 442
Joined: Tue Mar 16, 2010 10:58 am
Location: San Francisco, CA
Contact:

Re: Combine multiple heading selectors to control color?

Post by Phlawm53 »

Thanks all.

I figured out pretty quickly that Flare 6's built-in CSS style tools had some limitations when it came to some of the "fancier" CSS tricks. My central concern was whether editing CSS outside of Flare's built-in editors would create problems for me later on down the road.

Per the two responses I've received, the answer appears that using an external text editor like Notepad++ or jEdit (the latter a personal favorite because of all its plug-ins) creates no especial problems. That led me to try my experiment -- "centralizing" my headings' color specs -- which seems to be working just fine…

Cheers & thanks 'gain to all,
Riley
cbdebris
Sr. Propeller Head
Posts: 105
Joined: Wed Aug 15, 2007 4:15 pm
Location: California

Re: Combine multiple heading selectors to control color?

Post by cbdebris »

I've only run into a couple of quirks with editing the stylesheet outside of Flare 6. The primary one is Flare sometimes stops recognizing a style. That requires opening a topic with the assigned style and (even temporarily) assigning other text the "missing" style. Eventually Flare recognizes the style again.
All life is a blur of Republicans and meat. -- Zippy the Pinhead
Post Reply