How to bind stylesheet in jmix add-on project

Hi,

I have created add-on project in Jmix version 1.5.0 where I have created on sample form I am trying to apply style on that form but not working. can you please guide me where to create style.css file in add-on project and how it is bind to the application to apply style on form.

Hi,

You can include your styles.scss file to JAR manifest. In widget add-on documentation you can find the following (Creating and Using Widgets Add-On :: Jmix Documentation):

jar {
    manifest {
        attributes(['Vaadin-Widgetsets': 'com.company.demoaddon.DemoaddonWidgets',
                    'Vaadin-Stylesheets': 'VAADIN/addons/demoaddon/demoaddon.scss'])
    }
}

See also how it is done for jmix-dashboards/dashboards-ui

dashboards-ui.gradle

jar.manifest {
    attributes(['Vaadin-Stylesheets': 'VAADIN/addons/dashboards/dashboards.scss'])
}

The dashboards.scss placed under resources/VAADIN/addons/dashboards.