Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theming Variants support for components in Flow #4318

Closed
pleku opened this issue Jun 21, 2018 · 5 comments
Closed

Theming Variants support for components in Flow #4318

pleku opened this issue Jun 21, 2018 · 5 comments

Comments

@pleku
Copy link
Contributor

pleku commented Jun 21, 2018

When building UIs with component APIs, I want to use a high level API for customizing the look and feel of the components that my IDE can autocomplete for me, so that I can be productive

Currently in V10 it is required to use either the ThemeList mixin interface API or the Element API to access the theme attribute. The applicable theme variants for the components are not specified in anywhere in Java code.

Acceptance Criteria

  • For all component integrations that have either Lumo or Material theme variants
    • there must be a component level API for setting the variants
    • all applicable variants must be available somehow in Java
      • Must be autocompletable for that specific component, and preferably should make sure that the used theme has that variant (Lumo/Material)
  • The documentation is updated to have examples on how to use the variants and where the variants are available (in Java)
  • The component demos highlight the usage of different variants
    • Can be limited to only eg. Lumo theme, or whatever is active on that page, because the HTML examples also showcase the Lumo variants
@pleku
Copy link
Contributor Author

pleku commented Jun 21, 2018

We already have the HasTheme interface in V10, so the same API should be used.

@pleku
Copy link
Contributor Author

pleku commented Jun 21, 2018

An example of how the variants are defined in the component resources https://github.com/vaadin/vaadin-button/blob/master/theme/lumo/vaadin-button-styles.html#L42

@SomeoneToIgnore
Copy link
Contributor

Variants support is added to the generator, the components have been regenerated.

What's left:

  • put the generated files into each component repo
  • update components that are not generated
  • update the documentation
  • update the demos

Before proceeding with the task, it might make sense to wait until components with Material theme are used in generator so that all the components have variants for both themes.

@SomeoneToIgnore
Copy link
Contributor

vaadin-ordered-layout-flow does not extend autogenerated class and does not implement HasTheme.
He also has special methods for setting all three theme variants and for accessing theme attribute contents.

Hence, in order not to duplicate the API, no variants added.

vaadin/vaadin-ordered-layout-flow#71

@ZheSun88
Copy link
Contributor

related APIs has been added and demos have been added to components too.
documentation about using theme variant : vaadin/flow-and-components-documentation@b214e41

ready to finish this ticket

@pleku pleku closed this as completed Jul 30, 2018
@pleku pleku modified the milestones: 1.1, 1.1.0.alpha2 Jul 30, 2018
@pleku pleku changed the title Using Theming Variants for components should be easy Theming Variants support for components in Flow Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants