Jay Elrod
Jay Elrod

Reputation: 738

CSS in vaadin plugin for grails

I am using the vaadin plugin for grails, and am trying to define some custom styles. Where within my grails appliction should I put the .css? My Vaadin application is in /vaadin/ I have tried creating a /vaadin/themes/mytheme/ folder and then putting my styles.css file in there, but still had no luck. Any help would be greatly appreciated. New to grails and new to vaadin, and am pulling my hair out over small stuff like this and can't get any of the actual legwork done until I can figure these things out..

Any way of doing inline styling would be fine with me too, at this point. I really just need some way to write explicit style..

Thanks

Upvotes: 1

Views: 482

Answers (2)

ollitietavainen
ollitietavainen

Reputation: 4290

With the latest version of the plugin:

  • The name of the file must be styles.css (or styles.scss, which will then be compiled to styles.css by the command grails prod war)
  • The file must be located in /web-app/VAADIN/themes/mytheme , where the last part is the name of your style
  • In your UI file, use the @Theme annotation, for example

    @Theme("mytheme")
    @VaadinUI(path = '/')
    class MyUI extends UI {
    // ...
    
  • In VaadinConfig.groovy, specify the styles used by the application:

    themes = ['mytheme']
    

Upvotes: 1

thomers
thomers

Reputation: 2693

You need to put it into /web-app/VAADIN/themes/mytheme

You can have a look at the completed addressbook tutorial (with added Gorm and Spring Security Core support)

Upvotes: 2

Related Questions