Is there a way to change dynamically the lumo primary colors:
html {
  --lumo-primary-text-color: hsl(214, 35%, 15%);
  --lumo-primary-color-50pct: rgba(140, 236, 0, 0.5);
  --lumo-primary-color-10pct: rgba(140, 236, 0, 0.1);
  --lumo-primary-color: #8CEC00;
  --lumo-primary-contrast-color: hsl(214, 35%, 15%);
}
Thanks in advance!
Best Regards, Thomas
The CSS variables can be updated dynamically from Java like so
UI.getCurrent().getElement().getStyle().set("--lumo-primary-text-color", "hsl(214, 35%, 15%)")
This will update the variable's value for the whole UI. If you want to change the variable only for a specific component (and its children), then you can call getElement().getStyle().set() on that component only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With