Re: How to add multiple formats for <li> element in <ul>

Ozana Dragomir

Here is our code for different bullet colours:

In lists-attr.xsl

    <xsl:variable name="custom-color-purple">#72166B</xsl:variable>
    <xsl:variable name="custom-color-blue">#6687B7</xsl:variable>

    <xsl:attribute-set name="ul.li__label__content">
        <xsl:attribute name="text-align">start</xsl:attribute>
        <!-- change second level bullet color to blue and third level bullet color to purple -->
        <xsl:attribute name="color">
                <xsl:when test="count(ancestor::*[contains(@class, ' topic/ul ')]) = 2">
                    <xsl:value-of select="$custom-color-blue"/>
                <xsl:when test="count(ancestor::*[contains(@class, ' topic/ul ')]) = 3">
                    <xsl:value-of select="$custom-color-purple"/>

I hope this helps.

Best regards,

Join to automatically receive all group messages.