kszk
kszk

Reputation: 102

Vaadin Flow and external CSS (theme)

In Maven multi-module project with Vaadin Flow 14 how can I build a common/shared style/theme module and reuse/import in the web application module. Which one I should use in the web application. The @StyleSheet which can handle external CSS, or the newer @CssImport? Or do I have to use some maven plugin to copy reosurces (CSS files) from the theme module into the web app module (into the frontend or resources folder)? Is there any examples out there for vaadin 14 multi-module theming? Any hint would be great, thanks!

Upvotes: 0

Views: 368

Answers (1)

Tatu Lund
Tatu Lund

Reputation: 10643

There are possibly many ways to do this. I would assume the simplest way is to have component sub-module in your project. I have example here

https://github.com/TatuLund/bookstore-flow-ee/blob/master/bookstore-starter-flow-my-component/src/main/java/com/vaadin/samples/HelloWorld.java

The component itself can include styles, etc.

What I am proposing to you is to use similar custom component as base-layout of your application that imports the needed styles etc.

Upvotes: 1

Related Questions