Page 1 of 1

Cannot get custom CSS to work...

Posted: Tue Apr 28, 2020 5:47 am
by RBVanDyke
oXygen XML v22.

I simply cannot get custom CSS to work in either online or PDF output. Trust me -- I've been all over the oXygen XML online help (OLH) and the web for the variants. I can normally work through problems like this but I'm completely stuck.

I've resorted to customizing an oXygen XML transform; I'd rather do it via the command line. Regardless, in my XHTML output, the HEAD element contains a reference to my custom CSS after an unwanted reference to commonltr.css. After being important (I think) because my custom CSS styles should be applied later down the cascade(?)

Are there any examples of how to get customized CSS to actually be applied in either or both online and PDF output? None of the examples I've tried "take". Totally frustrated...

Cheers & thanks,
Riley
SFO

Re: Cannot get custom CSS to work...

Posted: Tue May 12, 2020 8:16 am
by Radu
Hi Riley,

Usually in order to add a custom CSS to the WebHelp and CSS-based PDF transforms, I edit the transformation scenario, in the Parameters list I set the parameter "args.css" to point to my custom CSS and the parameter "args.copycss" to "yes". Then I publish.
About this remark:
Regardless, in my XHTML output, the HEAD element contains a reference to my custom CSS after an unwanted reference to commonltr.css.
It's good that your custom CSS is referenced after the commonltr.css, this means that it can override CSS selectors from the base CSS.
Maybe your custom CSS does not work because it does not properly match elements in the HTML output.
For example if in the custom CSS you add this rule:

Code: Select all

* {color:red;}
do you manage to set red foreground on the entire HTML page? If it does, then you just need to work on the CSS selectors to properly match HTML elements in the page.

There are some ideas here about how to use a web browser's inspector view to see how various HTML elements should be matched:

https://www.oxygenxml.com/doc/versions/ ... h-css.html

Regards,
Radu