Page 1 of 1

using oxy_htmlcontent with pseudo-elements and -oxy-placeholder-content with the main element

Posted: Fri Feb 20, 2026 12:27 am
by jeff_hooker
Hi folks,
I've defined an element-by-element external help system for an internal schema and defined a custom style within Oxygen. I've linked to the external help system like this:

Code: Select all

dimension > namePattern:before(201) {
    display: inline;
    font-family: arial, helvetica, sans-serif;
    line-height: 1rem;
    margin-top: 0.4em;
    margin-bottom: 0.2em;
    content: oxy_htmlContent(href, 'register-hints.html', id, oxy_concat('register-hints', '-', oxy_local-name()));
  }
I would like the name of an empty element to appear as the element's default content, so I define it like this:

Code: Select all

 dimension > namePattern{
  -oxy-placeholder-content: oxy_name();
  }
However, when I have any content defined using the :before pseudo-element, the -oxy-placeholder-content is never visible. Is there a way of doing both of these things at once?

Re: using oxy_htmlcontent with pseudo-elements and -oxy-placeholder-content with the main element

Posted: Fri Feb 20, 2026 8:53 am
by Radu
Hi,
The docs says something like this:
https://www.oxygenxml.com/doc/versions/ ... nsion.html
Oxygen XML Editor displays the element name as pseudo-content for empty elements ... and there is no before or after content set in the CSS for this type of element.
So once you define a before or after the placeholder text is no longer displayed. You can kind of do something similar by using the ":empty" selector on the element with some static "content:" value placed.

Regards,
Radu