I think, vaadin needs a new ‘modern’ default theme and you are the person which encourages my hopes that this will happen one day.
I have problems to use it in my own project if I just copy and paste the theme and the enum. I will get lots of warning, errors and file not found exceptoions.
I’m very new in vaadin. It would be cool to have a simple and quick ‘how to use’ document. I’ll try it on my own and provide such a document if i was successful.
Well, that’s what we think as well, and I’ve been working on a new Sass based theme for quite a while now, which should be ready for beta when 7.2 is released.
Sorry to hear that. The only thing you should need to do is to copy the “bootstrap” theme folder over to your projects VAADIN/themes folder and copy the Bootstrap.java to your src folder. Then set the theme for your UI instance with the @Theme annotation.
If you wish to extend the theme, I would recommend that you just import the “styles.css” file directly, and not the “bootstrap.scss” file, there aren’t really any useful mixins, functions or variables that you can use from it.
I would love to have this feature… For some people and businesses, how your application looks (sadly) is as important as functionality…
I can’t stress out how important Themes and making us java developers “look good” is. By enabling tools to help us to that end is crucial when deciding which tool/framework to use.
I’ve found that without too much fuss (obviously objectional :D) you can integrate Twitter’s bootstrap components with the CustomLayout. An example below shows adding a dropdown button component.
First
Make the bootstrap.css or bootstrap.min.css file somewhere accessible to your theme’s css via an @import “path/to/file”;
Second
Make sure jquery and boostrap js files are available to your CustomLayout via the @JavaScript annotation. You can add this at the UI class so that the javascript is added to the head of the base html page. Make sure that you put the javascript files in the same src directory that your UI class is in (i.e src/com/example/bootstraptest/javascript.js). They won’t load correctly if they’re somewhere under your WebContent folder. Also, it’s important to put the jquery file first in the array since bootstrap requires it to run.
@JavaScript( value = { "jquery-1.11.0.min.js", "bootstrap.min.js" })
Third
Make sure you have the html file available under your /VAADIN/themes//layouts directory
They can also dynamically update my html with page by injecting different CustomLayout templates… you get the picture hopefully. Tie that in with a Navigator component, and you can serve what seems to be a purely html/css/javascript driven project with Vaadin and Java behind the scenes (even though that’s technically what Vaadin ultimately spits out anyways). I guess its a psuedo .jsp … but without having to learn jsp.
Interesting approach, totally not what what you normally should be using Vaadin for – but hey, if it works
After I started my hack for the Bootstrap CSS, there’s now actually a Sass based version of it available, which should perhaps more flexible to use. Haven’t investigated yet, but I hope I get a chance at some point.
I started learning Java about 5 months ago and have zero web design experience. In fact, I’m relatively new to coding/programming in general, so regardless of Java, any web framework would take time to learn and understand for me. The Vaadin paradigm was very appealing because the framework is very user friendly for people like me, but it’s complex enough for the people who really know what they are doing as well. The first project we did with Vaadin is very similar to the Dashboard demo. The layout was done completely with the Vaadin server side approach, no crazy gimmicks.
However, doing a lot of customization on the CSS theme proved to be difficult if we were trying to closely immitate some example site we’d seen. I needed to come up with a way that would allow me to benefit from some of the other web development tools that were out there, like quickly mocking up a page design with an html/css tool and figuring out an easy way to implement that skeleton design into our project. Several tools often allow you to build and then download on the spot, and getting that into Vaadin wasn’t easy for me to do initially.
I definitely agree this is not a conventional approach to using Vaadin. However, this opens the door for me to use anyone’s theme regardless of it being bootstrap. And, since most themes are built with the html and css closely intertwined, its difficult to just adopt just css side on its own. This also provides a way to take care of importing the javascript needed to accompany these other themes with relative ease.
All in all, I just think that Vaadin is a really versatile framework. It allows users to not only follow the guidelines laid out in documentation, but it also allows users to do unconventional and completely ludicrious things like I’ve tried, and get results.
Do you know if a tutorial to integrate the
Official Sass port of Bootstrap in Vaadin is available somewhere?
Sorry but I’m new to Vaadin the Readme on github didn’t help me a lot
Sorry, I’m quite sure there’s no good tutorial on that subject for now. If you plan to start the integration, you can ask for some help here if you want.
the ColorUtil.class (line 270) method public static float colorToHsl(LexicalUnitImpl color) gets 'Lexical unit node [adjust-hue(#dff0d8, -10)]
’ as the color argument. (As i debugged, this method should receive #rgb or #rrggbb) This is some kind of parser error? Or simply lack of adjust-hue method?
As you said, It looks like adjust-hue function might be missing. If you can create a reduced test for that, and create a ticket about it, it would great!
}
[/code]I needed to wrap Bootstrap in my theme so that it does not interfere with the site embedding the App (I’m using the CORS integration)
As you can see, I use the WebJar dependency for Bootstrap
Just giving my first steps with Vaadin, I’ve been trying to workout the “responsive design which could provide a vaadin interface working well in desktop, tablets and phones” part with Bootstrap 4 and Vaadin 14 and came up with a simple and straightforward solution.
In a documentation page explaining what’s include in Bootstrap, in a section dedicated to [CSS Files]
(https://getbootstrap.com/docs/4.4/getting-started/contents/#css-files), they state that “Bootstrap includes a handful of options for including some or all of our compiled CSS.”, which comes in 3 flavors:
All included - everything for Layout, Content, Components and Utilities;
Grid - Only grid system for Layout and Only flex utilities for Utilities;
Reset - Only Reboot for Content.
By only including their Grid CSS, I can now play with CSS classes to create responsive layouts. For those not familiar with Boostrap I recommend going through the following sections of their documentation: