Applying complex selectors to Word output

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
espirian
Jr. Propeller Head
Posts: 4
Joined: Wed Oct 08, 2014 5:36 am

Applying complex selectors to Word output

Post by espirian »

I'm unable to replicate some styling I use in my HTML5 output in the Word output. I'm using a complex selector, which is perhaps where things are going wrong.

This works fine in HTML5:

dt span[class^=button] {/* rules for HTML5 go here */}

Then I want to do something else for print, but it doesn't work:

@media print {
dt span[class^=button] {/* rules for print go here */}
}

I have a variable set just for buttons, and each variable ends up becoming a <span> with a class starting with "button", so I can target and style all such elements – except this doesn't work with the Word output.

Is there a way to apply such complex-selector styling in print outputs?
Paulie
Sr. Propeller Head
Posts: 140
Joined: Sun Mar 01, 2015 3:01 pm

Re: Applying complex selectors to Word output

Post by Paulie »

Hi there,

Unfortunately, I can't provide a lot of insight here, but I have encountered the same frustrations. Last year I asked MapCap Support for a definitive list of which complex selectors are supported for each target type. Unfortunately, they were not able to provide this information and pretty much told me to keep my own record and log bugs for the ones that didn't work.

It would be nice if somebody could provide some more insight. Perhaps we could use this topic to come up with our own definitive list.

EDIT: Tip...
If you are trying to style variables in the Word output, you can use the MadCap|variable selector in your CSS. You would then have to apply this class to your variables, so it is not as seamless as complex selectors.

Example:

Code: Select all

MadCap|variable.Code
{
	font-family: 'Courier New';
	font-weight: normal;
}
Be warned though that this is a bug that only works for Word outputs. The above code is only supposed to style the variables in the WYSIOP editor and not affect the actual outputs.
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
espirian
Jr. Propeller Head
Posts: 4
Joined: Wed Oct 08, 2014 5:36 am

Re: Applying complex selectors to Word output

Post by espirian »

Hi, Paulie, and thanks for your help.

The idea about using the custom variable code might do the trick, as the items in the definition list I'm trying to style are all made up of variables. Nice tip!
Post Reply