Support for CSS pseudo-class :has()

Hello, Is there any chance that a future version of Oxygen will support the CSS pseudo-class :has() ? I tried the following rule in a stylesheet entry:has(> styled-content) { background-color: #DDEEFF; } but the table cell (<entry>) with a child <styled-content> element didn’t get the expected light blue background. -- Michael R. Boudreau Electronic Publishing Technology Manager The University of Chicago Press 1427 E. 60th Street Chicago, IL 60637 www.journals.uchicago.edu

Hi Michael, Oxygen supports the has() pseudo class selector and this is documented: https://www.oxygenxml.com/doc/ug-editor/topics/has-selector.html From what I tested in your case a selector like this should work in Oxygen:
entry:has(styled-content) but if an extra ">" is prepended inside the has() pseudo class it stops working with Oxygen.
From what I tested a web browser supports both has() value styles (with or without the > prefix). I also looked in the CSS specification and I added an internal issue to also support in Oxygen the selector if it has a leading ">". Regards, Radu Radu Coravu Oxygen XML Editor On 11/1/22 23:09, Michael Boudreau wrote:
Hello,
Is there any chance that a future version of Oxygen will support the CSS pseudo-class :has() ? I tried the following rule in a stylesheet
entry:has(>styled-content){ background-color:#DDEEFF; }
but the table cell (<entry>) with a child <styled-content> element didn’t get the expected light blue background.
--
Michael R. Boudreau
Electronic Publishing Technology Manager
The University of Chicago Press
1427 E. 60^th Street
Chicago, IL 60637
www.journals.uchicago.edu
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com https://www.oxygenxml.com/mailman/listinfo/oxygen-user

Thanks, Radu! I was following the example at https://w3c.github.io/csswg-drafts/selectors/#relational and assumed the leading “>” was required. Without it, my CSS rule works as I’d hoped. -- Michael R. Boudreau Electronic Publishing Technology Manager The University of Chicago Press 1427 E. 60th Street Chicago, IL 60637 www.journals.uchicago.edu From: oXygen-user <oxygen-user-bounces@oxygenxml.com> on behalf of Oxygen XML Editor Support (Radu Coravu) <support@oxygenxml.com> Date: Wednesday, November 2, 2022 at 12:08 AM To: oxygen-user@oxygenxml.com <oxygen-user@oxygenxml.com> Subject: Re: [oXygen-user] Support for CSS pseudo-class :has() Hi Michael, Oxygen supports the has() pseudo class selector and this is documented: https://www.oxygenxml.com/doc/ug-editor/topics/has-selector.html<https://urldefense.com/v3/__https:/www.oxygenxml.com/doc/ug-editor/topics/has-selector.html__;!!BpyFHLRN4TMTrA!-nWvGX_BF8uytD1leIWH_9T8cjz8EWGFQ6bS1Z5lKO1oVD0dztiLGllNULnO0Ah3Xhi060oh8bDzCgf0MBEiYETV$>
From what I tested in your case a selector like this should work in Oxygen: entry:has(styled-content) but if an extra ">" is prepended inside the has() pseudo class it stops working with Oxygen.
From what I tested a web browser supports both has() value styles (with or without the > prefix).
I also looked in the CSS specification and I added an internal issue to also support in Oxygen the selector if it has a leading ">". Regards, Radu Radu Coravu Oxygen XML Editor On 11/1/22 23:09, Michael Boudreau wrote: Hello, Is there any chance that a future version of Oxygen will support the CSS pseudo-class :has() ? I tried the following rule in a stylesheet entry:has(> styled-content) { background-color: #DDEEFF; } but the table cell (<entry>) with a child <styled-content> element didn’t get the expected light blue background. -- Michael R. Boudreau Electronic Publishing Technology Manager The University of Chicago Press 1427 E. 60th Street Chicago, IL 60637 www.journals.uchicago.edu<http://www.journals.uchicago.edu> _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com<mailto:oXygen-user@oxygenxml.com> https://www.oxygenxml.com/mailman/listinfo/oxygen-user<https://urldefense.com/v3/__https:/www.oxygenxml.com/mailman/listinfo/oxygen-user__;!!BpyFHLRN4TMTrA!-nWvGX_BF8uytD1leIWH_9T8cjz8EWGFQ6bS1Z5lKO1oVD0dztiLGllNULnO0Ah3Xhi060oh8bDzCgf0MOysz46Q$>
participants (2)
-
Michael Boudreau
-
Oxygen XML Editor Support (Radu Coravu)