Changing the CSS used in the XML Editor

This forum is for all Flare issues not related to any of the other categories.
Post Reply
AndrewCampbell
Propeller Head
Posts: 24
Joined: Thu Nov 10, 2016 4:19 am

Changing the CSS used in the XML Editor

Post by AndrewCampbell »

How can I change the CSS used to display the content in the XML editor?

I have read that the XML editor uses the CSS associated with the primary target, but I was wondering if there was a way of changing this without setting up a dummy primary target.

(As background: I'm working on a project that has PDF as its primary output. The CSS looks great for the PDF but awful in the XML editor.)
GregStenhouse
Sr. Propeller Head
Posts: 330
Joined: Tue May 13, 2008 3:27 pm
Location: Christchurch, New Zealand

Re: Changing the CSS used in the XML Editor

Post by GregStenhouse »

Are you looking at Layout(Print Layout) in the XML editor? This should show how it will look in the PDF and may make it look better. If there is a big discrepancy between how that looks and the final PDF, then I think you have a CSS problem (perhaps using complex selectors or other fancy CSS trickery that the XML editor doesn't recognize?) In that case I'd recommend simplifying your CSS e.g. use p.class, span.class (instead of generic .class), separate them out into single style defns etc. From what I've experienced if the Flare CSS editor recognises your CSS and you can modify styles from within Flare, then the XML editor will pick up the look and display them reasonably accurately. That may be different in your project of course, and it may pay to contact MadCap support if things are not appearing as they should.
AndrewCampbell
Propeller Head
Posts: 24
Joined: Thu Nov 10, 2016 4:19 am

Re: Changing the CSS used in the XML Editor

Post by AndrewCampbell »

That's not what I want to do. I want to use one CSS for the editor and a completely different one for the output.

One way of doing this is to create a new target, associate my 'editor' CSS with that target, and then set that target as the default target. I was wondering of there was a more elegant way of doing it.
cdschroeder
Sr. Propeller Head
Posts: 189
Joined: Mon Feb 22, 2016 9:18 am
Location: Cincinnati, OH

Re: Changing the CSS used in the XML Editor

Post by cdschroeder »

AndrewCampbell wrote:That's not what I want to do. I want to use one CSS for the editor and a completely different one for the output.

One way of doing this is to create a new target, associate my 'editor' CSS with that target, and then set that target as the default target. I was wondering of there was a more elegant way of doing it.
I agree with Greg - I'm not sure why your PDF stylesheet would look "awful" in the XML editor, unless the layout isn't set to print, or there's something quirky in the stylesheet.

However, if you really want to create a separate stylesheet for the editor, you can set it as the master stylesheet at the project level (in the Project tab > Project Properties). That should modify the look of the editor. Then, make sure Allow local stylesheets is selected, and verify that the target is still referencing your original stylesheet.
project-tab.png
project-properties.png
You do not have the required permissions to view the files attached to this post.
Casey

Image
AndrewCampbell
Propeller Head
Posts: 24
Joined: Thu Nov 10, 2016 4:19 am

Re: Changing the CSS used in the XML Editor

Post by AndrewCampbell »

cdschroeder wrote: I agree with Greg - I'm not sure why your PDF stylesheet would look "awful" in the XML editor, unless the layout isn't set to print, or there's something quirky in the stylesheet.
In this case, it is because the font for the PDF output looks nice as a PDF, but looks awful on screen.

In general, I prefer not to tie the look and feel of the content in the editor to the look and feel of the content in an output format, because any given topic can appear in several different output formats, none of which will necessarily look like each other.
However, if you really want to create a separate stylesheet for the editor, you can set it as the master stylesheet at the project level (in the Project tab > Project Properties). That should modify the look of the editor. Then, make sure Allow local stylesheets is selected, and verify that the target is still referencing your original stylesheet.
Thanks, this worked, although I did have to restart a couple of times due to what I assume is a caching issue.
Post Reply