[oXygen-user] Different display depending on contents

George Bina
Fri May 6 05:14:29 CDT 2016


Dear Pierre,

There is a CSS level 4 draft that specifies a relational pseudo-class 
":has()"
https://drafts.csswg.org/selectors-4/#relational
which can be used to provide the functionality that you need.
The good news is that oXygen implements this, so for example, if you 
have an XHTML document like

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<?xml-stylesheet type="text/css" href="test.css"?>
<html xmlns="http://www.w3.org/1999/xhtml">
     <head>
         <title></title>
     </head>
     <body>

         <ul>
             <li>normal</li>
             <li>Bold!!!
                 <ul>
                     <li>1</li>
                     <li>2</li>
                 </ul>
             </li>
             <li>Normal again</li>

         </ul>
     </body>
</html>

then the test.css referred in the file needs to contain

li:has(ul) {
     font-weight:bold;
}

in order to render the second list item with bold font.

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 06/05/16 12:40, Pierre Attar wrote:
> Hi,
>
> For a specific application, I need to parameterize the Oxygen editor in
> order to have a different display of list items depending on contained
> lists.
>
> More precisely, a level 1 item is bold if there are level 2 items
> contained in the list.
> Otherwise, it is regular.
>
> I know how to manage that while transforming for publishing bu I don't
> know how to reprensent that only using Oxygen CSS selectors.
>
>
> Any ideas ?
>
> Pierre
> _______________________________________________
> oXygen-user mailing list
> 
> https://www.oxygenxml.com/mailman/listinfo/oxygen-user
>


More information about the oXygen-user mailing list