Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Next »

DomUI supports Sass in SCSS format out of the box (since 2.0). The new 2.0 stylesheet (winter) is a scss stylesheet. These stylesheets are compiled on-the-fly by the DomUI server code, so changes made to the stylesheets take effect immediately.

Parameter support

You can pass parameters to scss style sheets by adding them to the URL for the style sheet. These parameters will be inserted into a "virtual" scss file called "_parameters.scss" which can be included in your scss stylesheet.

Stylesheets are cached inside the server for performance. Adding parameters means that each set of parameters requires a new sass compile and a new entry in the cache, so don't do things like adding a unique parameter per user.

Internals

The Sass stylesheets are handled by SassPartFactory: a buffered Part factory. This factory recognizes both .scss and .sass files. Since this is a buffered part factory all scss files compiled through it are cached in memory.

The actual compilation is done by asking the SassCompilerFactory for a compiler. New compiler implementations can be built and registered there. We currently have two implementations:

  • The jsass compiler, which uses the Java JSass wrapper to the libsass native library. This is the default compiler as it is up-to-date with the standards. The disadvantage is that this compiler might not be available on all platforms, and it might need a custom installation.
  • The Vaadin Sass compiler, part of the Vaadin framework. This is a Java native compiler but has quite a few bugs and does not support the latest standards fully. Development seems to have stopped: the last commit was from 2015.

The jsass compiler will be used unless the code finds out that it is not available, in which case it will fall back to the vaadin compiler. This of course might make your files not compile.



  • No labels