14

The new Valo theme is now the default in Vaadin 7.3 apps. This theme renders visually with widgets (buttons, fields, and so on) that are dramatically larger (wider and taller) than in the previous default Reindeer theme.

This kind of look is now popular in mobile apps in Android and iOS 7/8 as well as some web sites. But those contexts are for brief usage in the range of mere minutes. In contrast, business-oriented desktop-style apps are used by people for much longer work sessions, perhaps for hours on-and-off all day. And business-oriented apps present much more information in a denser format. For such use, the default rendering of the Valo theme is inappropriate. Specifically, the fonts are too thin and faint, and the size is too large for fonts and widgets.

Valo's claim to fame is that it is built to be adjustable and easy to morph just a few lines of Java and/or CSS code. Has any one experimented with altering Valo to be sized similar to the Reindeer theme? Any source code or instructions to share?

To be clear, my goal is simply reduce the visual height & width and their font size. I'm not asking about altering the design, I would be grateful just to get back some pixel space. I'm looking simply for the easiest and safest way to get the Valo widgets’ size to parallel the visual size of their counterparts in Reindeer theme.

In the short term, I will continue to override the default to use Reindeer, as described on this StackOverflow.com Question, Change from “Valo” theme to “Reindeer” in new Vaadin 7.3 app. But longer term, the Vaadin team is betting big on Valo. Eventually Reindeer will fall out of favor, so I would like to learn how to transition.

I did open Ticket # 14,909 to suggest providing a switch to make Valo automatically downsize to Reindeer scheme.

Some people have misread this post: we are not talking about storage size on disk. We are talking about pixels here, not bits. Visual size, not file size. Graphical layout, not widgetset optimization.

This Question was inexplicably closed as "too broad". Yet it continues to receive up-votes. I ask you up-voters to vote to re-open.

Community
  • 1
  • 1
Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
  • 3
    As for the vote to close because question is "too broad" - Perhaps the downvoter is not familiar with Vaadin theming in general and Valo specifically. The Valo theme is built to be customized, with various parameters for changing colors, fonts, roundedness of corners, puffiness or flatness, animations, opacity, borders, and more. See this [wiki tutorial](https://vaadin.com/wiki/-/wiki/Main/Valo+theme+-+Getting+started). Before attempting my own, I’m asking if anyone has already started building a set of customization code to approximate the size and perhaps look of the previous Reindeer theme. – Basil Bourque Oct 27 '14 at 01:09
  • 2
    `$v-font-size` is your starting point and next `$v-unit-size`. They both should bring you far. You could also remove all the rants in your question and make clear, if you are concerned about the visual size or the filesystem size of the generated code and i bet this question could be reopened. – cfrick Oct 28 '14 at 08:09
  • i'd start with https://github.com/vaadin/valo-demo/blob/master/src/main/webapp/VAADIN/themes/tests-valo-facebook/_variables.scss, change the colors to something greyish and adjust font/font-size and you are not that far off from reindeer. after all one has to go with the tides of time... – cfrick Oct 28 '14 at 15:01
  • I upvoted it, and reported it too moderators. There is an fairly easy solution which I just implemented in our app (posted here in @cfrick comment). Why someone would want to close this question? – kukis Oct 08 '15 at 07:25
  • 2
    @kukis the valo theme demo nowadays even provides an example for this https://github.com/vaadin/valo-demo/blob/69a1bcc1d709f9abdd759a419944f4c1ac6a6fb9/src/main/webapp/VAADIN/themes/tests-valo-reindeer/_variables.scss – cfrick Oct 08 '15 at 07:47
  • @Basil You're right! It was a misunderstanding on my part. Thanks for the clarification! The comment have been deleted. – Krayo Nov 27 '15 at 07:05
  • The Valo theme demo with Reindeer sizing seems to be [here](http://demo.vaadin.com/valo-theme/#!common). From the popup menu in the upper right corner choose “Migrate Reindeer”. [These dozen lines of CSS](https://github.com/vaadin/valo-demo/blob/69a1bcc1d709f9abdd759a419944f4c1ac6a6fb9/src/main/webapp/VAADIN/themes/tests-valo-reindeer/_variables.scss) may be in play, but I have not verified that. The widget sizing does seem better to me. But the thin fonts are not appropriate for business people using an app for much of their job. – Basil Bourque Mar 14 '16 at 04:17
  • This wiki page lists the main variables defined in Valo: [Valo theme - Getting started](https://vaadin.com/wiki/-/wiki/Main/Valo+theme+-+Getting+started) – Basil Bourque Apr 07 '16 at 03:12
  • FYI, in [Vaadin Flow](https://en.wikipedia.org/wiki/Vaadin#Vaadin_Flow) (versions 10 to 14), the successor to *Valo* theme is [*Lumo* theme](https://cdn.vaadin.com/vaadin-lumo-styles/1.6.0/demo/). As of Vaadin Flow 13 and 14, you can add an annotation to enable *Compact* mode, reducing the size and spacing of widgets. See Question, [*Engage “Lumo compact mode” in Vaadin 13 and later, for smaller size layouts*](https://stackoverflow.com/q/60348621/642706) – Basil Bourque Feb 22 '20 at 03:01

2 Answers2

2

To use the valo theme as a replacement for the reindeer theme you can configure the theme variables used for valo just like this:

$v-font-size: 12px;

$v-unit-size: 26px;
$v-unit-size--small: 20px;
$v-unit-size--tiny: 18px;

$v-layout-margin-top: 18px;
$v-layout-margin-right: 18px;
$v-layout-margin-bottom: 18px;
$v-layout-margin-left: 18px;
$v-layout-spacing-vertical: 7px;
$v-layout-spacing-horizontal: 6px;

(Source: Valo Demo Project - Reindeer Theme)


The section Book of Vaadin - Valo Theme explains in depth where to put those variables and how to customize the theme.

JDC
  • 4,247
  • 5
  • 31
  • 74
  • I do not understand your first paragraph above the divider line. If you are simply saying your solution is also mentioned in the comments, no need to explain that (except maybe for a mere mention of the comment poster’s name for credit). Quite often on Stack Overflow people mention a possible solution briefly as a comment while others take that idea, flesh it out by adding details and examples, and post an Answer. – Basil Bourque May 03 '17 at 18:09
  • Ok, I just wanted to clarify that I do not want to "steal" the credits :) – JDC May 03 '17 at 18:27
  • Then just add a brief note like "per the comment by AliceW" or "as noted in comment by SusanH". As it is now, that opening paragraph is a confusing distraction. – Basil Bourque May 03 '17 at 18:59
  • I just removed it completely then. – JDC May 04 '17 at 04:29
1

I also had the same issue when I switched from Reindeer to Valo theme.Using small font size and family before loading the theme solved my problem.

$v-font-size: 12px;
$v-font-family: sans-serif;

@import "../valo/valo.scss";
Waqar Detho
  • 1,502
  • 18
  • 17