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 » Tue Jun 14, 2016 5:59 pm

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: 6435
Joined: Fri Jul 09, 2004 5:18 pm

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

Post by Radu » Wed Jun 15, 2016 9:13 am

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 » Wed Jun 15, 2016 12:45 pm

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 » Mon May 06, 2019 11:46 pm

Hi, Radu...I'd like to request a menu choice or icon to hide/show XML comments in author mode. Thx

sorin_carbunaru
Site Admin
Posts: 244
Joined: Mon May 09, 2016 9:37 am

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

Post by sorin_carbunaru » Tue May 07, 2019 10:32 am

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