[Maven/Vaadin] Multiple Themes issues

Hi all !

So, I’ve a little issue about vaadin and maven.
I have
two projects
. A
global one
with a lot of things in it, and a
small one
which basicaly show a specific element.
Both projects have Vaadin themes. I’ve had my small project as a dependency of my global one, which work perfectly.
In one the page of my global project, I display a Layout which contain my small one.

The problem is :
the theme of my small project is not load at all when I display it
. No images, no css, nothing …
My small project’s jar contain theme, so I don’t get why this one is not load !?

So my question is : How should I do to have a sub-project with is own theme ?

I hope I made myself clear :stuck_out_tongue:

Regards

Hi,

If two different projects use the same theme, it sounds to me you should create a third project to build the theme. Your apps can then use that theme directly or extend from it. If theme stuff is available in classpath under VAADIN/yourthemename, Vaadin tooling should pick them up just fine.

cheers,
matti

Hi Matti, thanks for your answer.

The thing is, my small project will probably be used into other projects. This small project has its own theme and I don’t want
to create a third project to build the theme. This small project must be a kind of standalone which can be add as a maven dependency without doing anything else to get it work.

Should I create a kind of add-on then ?

Regards

I understood you already have two projects. Yes, create you own private add-on (a jar project) that contains your custom theme. You can also use it to contain othe reusable stuff (Java code).

cheers,
matti

Ok thanks, I’ll try that.

Regards

Hi,

I have a similar problem: I developed two project. The first project has a library with styles. The second project has a Web project that uses the style of first project with (@Theme(“themeBase”). Its works perfectly. Both project uses maven.

However when I try extend the style themeBase in the local theme of second project like the Valo theme (@import “…/valo/valo”:wink: its not works! I can compile the theme but when launch the web: “SEVERE: CSS files may have not loaded properly.”

any idea?

Hi

My sub project is a dependency of my main project in maven, and I forgot to load the style from my main project …
Here’s how to do it :

In the style.scss of my main project I imported my sub project’s style this way :

@import "../sub-project/style.scss

@mixin mainProject {
    @include valo;
    @include sub-project;
}

** adjust file and directory names of course **

This way, all the style of my sub-project are load on my main one.

Cheers