Organise Flare's stylesheet? It is such a mess

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
nickatwork
Sr. Propeller Head
Posts: 457
Joined: Thu Sep 16, 2010 6:31 am
Location: London

Organise Flare's stylesheet? It is such a mess

Post by nickatwork »

hi all,
I'm doing a bit of stylesheet work with new mediums etc and have had to look at the stylesheet itself both in Flare (i.e. code view) and after my webhelp is built.
I must say, the structure of the CSS file is a mess. from what I can tell the newest modified style is thrown at the bottom and thats about it. Settings don't stay within their medium as I end up having multiple declarations of the same medium...

So blah blah blah, is there any way in Flare to re-organise or sort the stylesheet?

Thanks,
Nick.
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: Organise Flare's stylesheet? It is such a mess

Post by crdmerge »

Reorganize it in the code (Flare's Internal Text Editor or Notepad).

Of course, if you add comments (for identifying groups of styles, etc.), Flare has the maddening habit of moving those comments around to where they make no sense any longer. Flare support has logged a bug on my behalf, and I "will be notified if a fix is done in a future release via email." Yeah...


Good luck,
Leon
nickatwork
Sr. Propeller Head
Posts: 457
Joined: Thu Sep 16, 2010 6:31 am
Location: London

Re: Organise Flare's stylesheet? It is such a mess

Post by nickatwork »

Yeah I didn't think it was likely but was hoping someone might have a work around. Just so annoying, makes it so messy, and styles in a medium that are using default settings are declared but have nothing applied - pointless?

I'll log a request with them too...

Thanks,
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: Organise Flare's stylesheet? It is such a mess

Post by crdmerge »

Be careful what you wish for...

I'd rather have Flare place the newest style at the bottom; I really wouldn't trust them to place it in the right spot. Would you? :wink:
nickatwork
Sr. Propeller Head
Posts: 457
Joined: Thu Sep 16, 2010 6:31 am
Location: London

Re: Organise Flare's stylesheet? It is such a mess

Post by nickatwork »

haha maybe so, but at least within the same medium declaration would be nice....I doubt it'll ever happen anyway.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Organise Flare's stylesheet? It is such a mess

Post by LTinker68 »

nickatwork wrote: from what I can tell the newest modified style is thrown at the bottom and thats about it.
That's typical behavior -- same thing happens in other web design programs I've used. But there is a reason for it -- the basic CSS rule is "the style that's closest to the content wins". There could be times where you have a combined style block followed by a single block for one of the styles. The single block will override whatever attributes were specified in the combined block. For example, in the code below, the margin-bottom attribute in the single <p> code block overrides the margin-bottom value specified for the <p> tag in the combined style block (the margin-bottom value is overriding the 4pt in the combined margin attribute). If the single <p> block appeared before the combined style block, then its margin-bottom value would be overridden by the margin:4pt value in the combined block. So the order of how styles appear in the stylesheet is important. Because of that, you can't always have all <p> styles in the same area or all list styles together, etc.

Code: Select all

p, ol, ul {
    font-size:10pt;
    margin:4pt;
}

p {
    margin-bottom:6pt;
}
nickatwork wrote:Settings don't stay within their medium as I end up having multiple declarations of the same medium...
This almost sounds like a bug, but the description's a bit vague, so it might also be by design. If you're saying that you see multiple @media print blocks, then yes, it's a bug. If you're saying you see "default" styles after the @media print block, then yes, those styles could be moved up to appear with the rest of the styles. Most web design programs assume you're refining your CSS as you go and may include overrides as described above, so it always puts newly-defined tags or classes at the bottom of the stylesheet file (or the bottom of a @media block). If you're specifying a new attribute for a tag you've already defined, then it will add the new attribute to the existing block, unless the existing block was a combination block, in which case it will create a new single block at the bottom of the file. However, all styles specifically for the print medium should all appear inside the single @media print block. In other words, you shouldn't have multiple instances of @media print, just one instance that contains multiple style blocks.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Organise Flare's stylesheet? It is such a mess

Post by i-tietz »

crdmerge wrote:Of course, if you add comments (for identifying groups of styles, etc.), Flare has the maddening habit of moving those comments around to where they make no sense any longer.
True - that was maddening ... now I just don't save the stylesheet in the stylesheet editor anymore, because that's what causes that reorganisation.
Inge____________________________
"I need input! - Have you got input?"
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Organise Flare's stylesheet? It is such a mess

Post by LTinker68 »

i-tietz wrote:
crdmerge wrote:Of course, if you add comments (for identifying groups of styles, etc.), Flare has the maddening habit of moving those comments around to where they make no sense any longer.
True - that was maddening ... now I just don't save the stylesheet in the stylesheet editor anymore, because that's what causes that reorganisation.
Does that mean if you edit the stylesheet outside of Flare then the comments aren't rearranged?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Organise Flare's stylesheet? It is such a mess

Post by i-tietz »

Jep. Outside Flare or with the text editor in Flare. But saving it once with the stylesheet editor is enough to "rearrange" the comments.
Inge____________________________
"I need input! - Have you got input?"
Phlawm53
Sr. Propeller Head
Posts: 442
Joined: Tue Mar 16, 2010 10:58 am
Location: San Francisco, CA
Contact:

Re: Organise Flare's stylesheet? It is such a mess

Post by Phlawm53 »

I'll mention that one of the better editors I've found for working directly with CSS, Flare or otherwise, is jEdit.

http://www.jedit.org/

jEdit does not prevent Flare's own CSS editor from mishandling CSS comments as described earlier in this thread, but does otherwise provides some features and Plugins specifically designed to make working with structured text (XHTML, CSS, et al.) and collections of files more efficient and (dare I say) pleasant.

Here are but a couple of jEdit plugins that make it easier to work with one or more Flare file types:
  • The Sidekick plugin makes it easier to find stuff and navigate in an alphabetical list of styles in a CSS (or other structured text) file.
  • The Project Viewer and Sessions plugin enables one to "package" one or more directories of files into a jEdit project.
  • The XML plugin provides auto-complete and validation for XML, HTML, JavaScript and CSS files.
Et cetera…

Note, too, that jEdit enables one to search across multiple files and directories for text contained within files. One example of where this is useful is managing all the hex color specifications of the form #123456 spread across multiple Flare project files. With a bit of REGEX, one can locate ALL the color specifications spread across a Flare project (CSS, Page Layouts, Master Pages, Tables, etc.), and replace a given color spec with another. jEdit makes this task MUCH faster and easier than trying to do it within Flare, I assure you…

jEdit may not directly "organize Flare's stylesheet", but it does make organizing a CSS file less painful…

Cheers & hope this helps,
Riley
Post Reply