-
Notifications
You must be signed in to change notification settings - Fork 70
Closed
Labels
DXDeveloper experience issueDeveloper experience issueenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Describe your motivation
This is a pure dx improvement / core readability request.
- To override the current theme variants, it is necessary to remove them manually first and then add a new one (if one wants to use theme variants):
button.removeThemeNames(button.getThemeNames().toArray(String[]::new))
button.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
- To apply/remove a theme variant to/from a component depending on a boolean, it is necessary to create an if-else like
if (someCondition) {
button.removeThemeVariants(ButtonVariant.LUMO_PRIMARY);
} else {
button.addThemeVariants(ButtonVariant.LUMO_PRIMARY);
}
Both use cases add unnecessary overhead and at least the 1 case is not really intuitive.
Describe the solution you'd like
Please provide a setThemeVariants
method similar to the setThemeName(String, boolean)
variant,
something like setThemeVariants(Variants...)
(use case 1) and setThemeVariants(boolean , Variants...)
(use case 2).
Describe alternatives you've considered
See the snippets.
Additional context
No response
Metadata
Metadata
Assignees
Labels
DXDeveloper experience issueDeveloper experience issueenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers