Hide XML Comments with CSS or LESS in Author Mode

Having trouble installing Oxygen? Got a bug to report? Post it all here.
friedemann_bach
Posts: 48
Joined: Wed Oct 22, 2014 4:11 pm

Hide XML Comments with CSS or LESS in Author Mode

Post by friedemann_bach »

Dear Forum!

Is there a way to hide XML Comments in the Author Mode using CSS or LESS (a) in general and (b) in specific elements?
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Hide XML Comments with CSS or LESS in Author Mode

Post by Radu »

Hi,

You first need to define a namespace declaration in the CSS like:

Code: Select all

@namespace oxy "http://www.oxygenxml.com/extensions/author";
and then match the XML comment something like:

Code: Select all

oxy|comment {
display:none !important;
}
That !important flag needs to be set because the builtin styling CSS added by Oxygen by default specifies most of its selectors using the !important flag so you need to overwrite that:

https://www.oxygenxml.com/doc/versions/ ... ctors.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
friedemann_bach
Posts: 48
Joined: Wed Oct 22, 2014 4:11 pm

Re: Hide XML Comments with CSS or LESS in Author Mode

Post by friedemann_bach »

Great, Radu, thank you very much!
sfogel2
Posts: 6
Joined: Fri Nov 06, 2009 8:33 pm

Re: Hide XML Comments with CSS or LESS in Author Mode

Post by sfogel2 »

Hi, Radu...I'd like to request a menu choice or icon to hide/show XML comments in author mode. Thx
sorin_carbunaru
Posts: 398
Joined: Mon May 09, 2016 9:37 am

Re: Hide XML Comments with CSS or LESS in Author Mode

Post by sorin_carbunaru »

Hi Steve,

You can create an alternate CSS (see https://www.oxygenxml.com/doc/versions/ ... t-CSS.html), which will be displayed in the Styles menu from the toolbar.

All the best wishes,
Sorin Carbunaru
oXygen XML
Post Reply