Kotlin still does not support repeatable non-SOURCE annotations. That affects CssImport
. And hence, this does not compile:
@Route
@CssImport("./styles/shared-styles.css")
@CssImport(value = "./styles/vaadin-text-field-styles.css", themeFor = "vaadin-text-field") // Compilation ERROR
class MainView(@Autowired service: GreetService) : VerticalLayout() {
Was hoping for a trick such as:
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.CLASS)
annotation class CssImports(vararg val cssImport : CssImport)
@Route
@CssImports(
CssImport("./styles/shared-styles.css"),
CssImport(value = "./styles/vaadin-text-field-styles.css", themeFor = "vaadin-text-field")
)
class MainView(@Autowired service: GreetService) : VerticalLayout() {
But no luck. I am guessing Vaadin scanning is not picking it up correctly. Any suggestions?