CSS :before and :after presentation in Author view

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
ra0543
Posts: 80
Joined: Wed Jan 14, 2009 12:50 pm

CSS :before and :after presentation in Author view

Post by ra0543 » Tue Jun 02, 2020 7:21 pm

When tags are displayed in the Author view of version 22.0 any display text that is added (for presentation) using CSS :before and :after is now appearing inside the tags in question rather than before and after the tags (unlike in at least some previous versions).

E.g. previously

<example>first item</example><element>text</element><element>text</element>

with

element:before {content:", "}

used to look like this:

[example>first item<example], [element>text<element], [element>text<element]

whereas now it looks like this:

[example>first item<example][element>, text<element][element>, text<element]

Is it possible to go back to the previous display option? If not, in which version was this change made (so I can uninstall and look for that previous version)?

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: CSS :before and :after presentation in Author view

Post by Radu » Wed Jun 03, 2020 3:22 pm

Hi,

Indeed we took this decision in Oxygen 21.1 to always display all the element's content (even before and after blocks) inside the tags.
We do not have a setting for this. Maybe if you give me more details about your use case, maybe some screenshots I can add an internal issue to consider adding some setting to control this behavior.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

ra0543
Posts: 80
Joined: Wed Jan 14, 2009 12:50 pm

Re: CSS :before and :after presentation in Author view

Post by ra0543 » Wed Jun 03, 2020 3:54 pm

Thanks for the info. I am thinking of, for instance:

Code: Select all

<Address type="Correspondence"><StreetAddress>Test data</StreetAddress><AddressLine2>Test data</AddressLine2><Town>TEST</Town><Postcode>ABCD 1234</Postcode><Country>ANYWHERE</Country></Address>
with this CSS:

Code: Select all

Address>*:before {content:", "}
Postcode+Town:before {content:" "}
Address:before {content:attr(type)": ";color:#196619;font-weight:bold}
Address>*:first-child:before {content:""}
Address[type='Correspondence']>* {font-style:italic;color:#196619}
I don't remember how to attach the screenshot that I've made, but if you put those two together you'll see the effect is weird, with the :before commas and spaces inside the elements rather than before them.

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: CSS :before and :after presentation in Author view

Post by Radu » Thu Jun 04, 2020 6:30 am

Hi,

If you want you can completely hide inline tags for certain elements like:

Code: Select all

Address {
    -oxy-display-tags:none;
}
and then add some image markers on the before and after content to emulate them.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: CSS :before and :after presentation in Author view

Post by Radu » Thu Jun 04, 2020 6:32 am

Coming back to this, maybe for such cases our form control text fields may make things look better:

Code: Select all

Address {
    -oxy-display-tags:none;
    content: oxy_textfield(edit, "#text", columns, 10);
    visibility:-oxy-collapse-text;
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

ra0543
Posts: 80
Joined: Wed Jan 14, 2009 12:50 pm

Re: CSS :before and :after presentation in Author view

Post by ra0543 » Thu Jun 04, 2020 11:35 am

Thanks, but I think I'll go back to an earlier more user-friendly version from before this was implemented, not least because I don't want to have to rewrite hundreds of lines of CSS.

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: CSS :before and :after presentation in Author view

Post by Radu » Fri Jun 05, 2020 6:33 am

Hi,

I will add an internal issue with your problem and we'll discuss about adding a setting to control this behavior.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply