flow
flow copied to clipboard
Improve API for setting Lumo compact variant
Describe your motivation
Currently, in order to trigger Lumo's compact variant, one should add the following annotation:
@JsModule("@vaadin/vaadin-lumo-styles/presets/compact.js")
However, this approach is neither typesafe nor obvious to developers to figure out on their own.
Describe the solution you'd like
Improve the API for setting the compact variant by:
- Providing a method to set the compact mode dynamically.
- Extending the
@Theme
annotation so that one can use it to statically enable the compact mode (in a way analogous to how one can use the@Theme
annotation to set Lumo light/dark mode).
I think we should discuss the role of “global” theme variants and how they are implemented before implementing new API related to them. @rolfsmeds, you should track this issue as well.