Hi Dinesh,
Sampler compiles a new theme on the server for every variable change applied in the theme switch control. First it uses UI.setTheme() with a dynamic theme name to make the client request for a new css file.
There’s a custom tailored servlet filter which then catches requests for the theme files and does the sass compilation including the dynamic variables (stored in a session attribute before the first phase) and returns the resulting css for the client.
The source code is intentionally not public as it’s a dirty hack implemented for demonstrational purposes only It bypasses much of the default behaviour of Vaadin so the code is not even guaranteed be backwards compatible.