How do I add a condition to a CSS style

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Yaacov
Propeller Head
Posts: 31
Joined: Mon Aug 03, 2015 12:42 am

How do I add a condition to a CSS style

Post by Yaacov »

I would like to add a condition to my CSS that if body text appears on the first page of a chapter the font color will change from #404040 to #dcdcdc.
How do I add this condition?
In the MainStyles.css file, there is a p.FirstPageOfChapter style and there is a printSupport property called mc-heading-level. But, I would like everything in the heading (body text) to be changed too.
Any help would be greatly appreciated.

Yaacov
kkelleher
Sr. Propeller Head
Posts: 163
Joined: Wed Nov 12, 2008 12:42 pm

Re: How do I add a condition to a CSS style

Post by kkelleher »

Hi again, Yaacov,

I don't think there's a concept of 'conidtional CSS' as such -- the CSS is applied based on the type of output you're generating. Each target's output type is associated with a medium. In your stylesheet, you'll see that there are multiple media (by default, you have (default), non-print, and print media. Create new styles in the print media for each style that should be a different color on the first page of a chapter, and apply those styles to the paragraphs in the topic that appears on the first page of each chapter.

Thanks,

Kristen
Kristen Kelleher
Director of Tech Pubs, TIBCO Jaspersoft
Yaacov
Propeller Head
Posts: 31
Joined: Mon Aug 03, 2015 12:42 am

Re: How do I add a condition to a CSS style

Post by Yaacov »

Thanks for your reply.
I ended up just using a <dev> with a color property on the text that falls on the first page of a chapter. The problem is in the future if text is added or deleted I need to remember to move the </dev> code. I would have preferred to have somehow automated this process.

Yaacov
Post Reply