flow icon indicating copy to clipboard operation
flow copied to clipboard

Improve API for setting Lumo compact variant

Open tarekoraby opened this issue 1 year ago • 1 comments

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).

tarekoraby avatar Aug 08 '22 12:08 tarekoraby

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.

jouni avatar Aug 08 '22 12:08 jouni