Dynamic styleClass in web-item

Hello everyone,

Bitbucket Server has this neat little feature of highlighting entries in the Administration overview if something is not configured:

I tried to reproduce this for one of our plugins. My idea was to use a ContextProvider, which determines the content for the label and the styleClass. Here is the coresponding definition of the web-item from the plugin.xml:

<web-item name="Secure Login Admin Config Web Item" key="secureloginAdminConfigWebItem" section="atl.admin/secureloginAdminWebSection">
        <label>Secure Login Config</label>
        <link>/plugins/servlet/twofactor/admin</link>
        <tooltip>$message</tooltip>
        <context-provider class="de.syracom.bitbucket.plugins.securelogin.admin.AdminConfigContextProvider" />
        <styleClass>$styleClass</styleClass>
    </web-item>

In result the description (or tooltip in case of Bitbucket) get filled with the value the ContextProvider puts into the context map. But this does not seem to work in case of the styleClass attribute. As you can see from the generated html code, the $styleClass variable does not get replaced:

<li>
<a href="/bitbucket/plugins/servlet/twofactor/admin" class="$styleClass" title="Active configuration for the Secure Login plugin." data-web-item-key="de.syracom.bitbucket.plugins.securelogin:secureloginAdminConfigWebItem">Secure Login Config</a>
<span class="description">Active configuration for the Secure Login plugin.</span>
</li>

Does anyone know, if there is a way to fill the styleClass Attribute over the context or another way to archive the desired effect to change the style of the description based on state of the plugin?

Cheers,
Alexander

In case someone else runs into the same question as me: a valid workaround is, to define two web-items with a condition, based on the state:

<web-item name="Secure Login Admin Configured Web Item" key="secureloginAdminConfiguredWebItem" section="atl.admin/secureloginAdminWebSection">
        <label key="securelogin.webitem.admin.config.label"/>
        <link>/plugins/servlet/twofactor/admin</link>
        <tooltip key="securelogin.webitem.admin.config.tooltip.configured"/>
        <condition class="de.syracom.bitbucket.plugins.securelogin.admin.PluginConfiguredCondition"/>
        <resource type="download" name="securelogin.css" location="/css/securelogin.css"/>
    </web-item>

    <web-item name="Secure Login Admin Not Configured Web Item" key="secureloginAdminNotConfiguredWebItem" section="atl.admin/secureloginAdminWebSection">
        <label key="securelogin.webitem.admin.config.label"/>
        <link>/plugins/servlet/twofactor/admin</link>
        <tooltip key="securelogin.webitem.admin.config.tooltip.unconfigured"/>
        <styleClass>securelogin-admin-unconfigured</styleClass>
        <condition class="de.syracom.bitbucket.plugins.securelogin.admin.PluginConfiguredCondition" invert="true"/>
        <resource type="download" name="securelogin.css" location="/css/securelogin.css"/>
    </web-item>

But I would be still interested, if there is a more elegant way, to archive this.