CSS Mediums not working correctly

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
AshleyQ
Propeller Head
Posts: 11
Joined: Wed May 28, 2008 8:18 am

CSS Mediums not working correctly

Post by AshleyQ »

I’m attempting to use one style sheet with two different mediums, one for the Web help and the other for our printed doc. This is the procedure that I’ve followed so far:

- I imported the source from Word. I did not link it to a style sheet and I wanted to preserve Word styles.
- I used the style sheet created from the Word import as my style sheet for the project. Thus, all I had to do was change the non-print medium. So I selected non-print, and made changes to the styles.
- I associated my master pages and content with the style sheet.
- In my target, I selected the master page to use and the style sheet medium.

Despite this, every time I build my Web help target, the styles are the same as my print target. I’ve looked at the style sheet using a text editor, and every thing looks fine. The non-print medium is defined and looks great.

I’ve found that I can get my Web help to look good, if I over ride the default medium. But then my print target picks up the Web help styles.

I suspect I’m missing something really basic, but I’ve worked with this all morning and I cannot figure out what I’m doing incorrectly. How can I use style sheet mediums correctly?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: CSS Mediums not working correctly

Post by LTinker68 »

Generally, I recommend doing all your style definitions in the "default" medium. Then switch to the "print" medium when you want to different the appearance of a style from how it would appear normally. For instance, my default font family is Verdana, Arial, sans-serif, but in my print medium, I'll occasionally set the font to Times New Roman due to the end user's requirements. I've never actually used the non-print medium.

You might want to delete the stylesheet that was created when the project was created (the one Flare created, not the one created during the import). If something is referencing that stylesheet, then I believe Flare will flash a warning while compiling indicating that it's missing.

There are also lots of locations in the stylesheet itself where fonts can be set. Check the html, body, and p tags, especially, to make sure that they're not using contradictory fonts. Open the stylesheet in the Internal Text Editor or Notepad to look at the styles. While in the Internal Text Editor view, scroll down to the @media print section to make sure which styles are set there.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: CSS Mediums not working correctly

Post by doc_guy »

In addition to what Lisa said, make sure that the stuff Word imported got put in the @print { } section of the style sheet; if that is what happened by default, I'd be surprised. I thought Word would create entries to the style sheet in the default section, not the print section of the style sheet.

Then, be sure your targets have the media types set properly.
Paul Pehrson
My Blog

Image
AshleyQ
Propeller Head
Posts: 11
Joined: Wed May 28, 2008 8:18 am

Re: CSS Mediums not working correctly

Post by AshleyQ »

Thanks so much for your input/suggestions Paul and Lisa.

The source .docs for the import included all the print styles. So I was hoping that I could make the print styles in the CSS the default medium, and then create a non-print medium that reflects the help styles. For whatever reason, (maybe Flare won't accept Word targets with anything but print as a medium?), I could not get the style mediums to work correctly.

What I ended up doing was completely counterintuitive and created more work for me. I changed all the styles in my default medium, which reflected my print styles, to reflect the help styles. I then created a print medium, and changed all the help styles back to the print styles. It was a complete PITA. I really wish that there was a quick way to apply more than one CSS to several topics at once, as that would have saved me a lot of time. Since I have a few thousand topics, there was no way I was going to apply multiple CSS one topic at a time.

I really do like Flare and the flexibility it offers. In the long run, it's going to save me a lot of time and hopefully move my content out of Word. But it just seems like its little quirks end up being so time consuming.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: CSS Mediums not working correctly

Post by LTinker68 »

AshleyQ wrote:So I was hoping that I could make the print styles in the CSS the default medium, and then create a non-print medium that reflects the help styles.
You should have been able to change the target editor to use the default medium, which would have used all the styles in the stylesheet outside of the @media print and other medium groups in the stylsheet. By default, the print outputs (Framemaker and Word) are set to use the print mediums. When you set the Stylesheet Editor to the print medium and modify styles, Flare automatically puts those styles within that @media print group. If you left the target editor set to the print medium, then it would have looked within the @media print group of styles within the stylesheet, which apparently isn't where most of your styles are.
AshleyQ wrote:I really wish that there was a quick way to apply more than one CSS to several topics at once...
Do you mean apply references to a stylesheet to multiple topics simultaneously (which you can do in Flare), or do you mean add the same tag to multiple topics simultaneously (which you can't do)?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Paul Griffiths
Sr. Propeller Head
Posts: 261
Joined: Wed Apr 18, 2007 2:25 am
Location: Nottingham, UK

Re: CSS Mediums not working correctly

Post by Paul Griffiths »

I agree that it would be nice if Flare allowed you to apply more than one CSS file to multiple topics.

However, if you know that you will always want to apply MyStyles.CSS and MyOtherStyles.CSS together, but still want (for some reason) to maintain them as separate CSS files, you can always link to MyOtherStyles.CSS from within MyStyles.CSS. Then applying MyStyles.CSS gets you MyOtherStyles.CSS too. Seems to work OK from the (limited) testing I have done.

Not sure this helps with Ashley's particular problem, though...
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: CSS Mediums not working correctly

Post by LTinker68 »

Paul Griffiths wrote:I agree that it would be nice if Flare allowed you to apply more than one CSS file to multiple topics.
You can't apply multiple stylesheets from the Topic Properties screen, but you can by going to Tools > Stylesheet Links.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Paul Griffiths
Sr. Propeller Head
Posts: 261
Joined: Wed Apr 18, 2007 2:25 am
Location: Nottingham, UK

Re: CSS Mediums not working correctly

Post by Paul Griffiths »

Hi Lisa. Yeah, but you have to do this one topic at a time (unless you know otherwise)! I'd like to be able to do this for several topics at once.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: CSS Mediums not working correctly

Post by LTinker68 »

I tried it using both the File List feature and the Show Files feature and although I can select multiple topics simultaneously, the Stylesheet Links option only seems to work on whichever topic is currently selected in the XML Editor. So the only option would be to do a find-and-replace, where you find the one line of the stylesheet reference and replace it with the same line plus the new stylesheet reference line.

But you should submit a feature request asking for the ability to apply multiple stylesheets to topics. You should be able to do it when you create a topic and later if you want to modify it. Submit the feature request at http://www.madcapsoftware.com/bugs/submit.aspx.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Post Reply