-1

I am kinda new to Vaadin and I use vaadin 13.0.13. I tried to refactor some code using the css file i created and put in src/main/resources/com/example/demo. I followed the documentation here. However as you can see on the following picture, it seems vaadin does not read that file.

Is there a particular reason ? What should I do to add a css file in my vaadin/spring project ?

Thanks.

picture1

Sox -
  • 592
  • 1
  • 9
  • 28

1 Answers1

2

From the comment in documentation you linked:

Probably the place where it should be added same as for v10-v13 so: Non-Spring project: /src/main/webapp/frontend Spring project: /src/main/resources/META-INF/resources/frontend

So, depending on your project, it's either:

  • /src/main/webapp/frontend (Non-spring)

  • /src/main/resources/META-INF/resources/frontend (Spring project)

A good overview of right locations for static resources could be found here Where should I place my Vaadin 10+ static files? The section you should check is Vaadin 10-13, Vaadin 14 in compatibility mode

anasmi
  • 2,562
  • 1
  • 13
  • 25
  • @StyleSheet("style.css") Non-Spring project: /src/main/webapp/frontend Spring project: /src/main/resources/META-INF/resources/frontend. It seems that you should not give the full path, now it works. Thanks ! – Sox - Jan 14 '20 at 14:29