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

Custom theme feature backporting from master to 2.6 #9983

Closed
5 of 6 tasks
pleku opened this issue Feb 8, 2021 · 4 comments
Closed
5 of 6 tasks

Custom theme feature backporting from master to 2.6 #9983

pleku opened this issue Feb 8, 2021 · 4 comments
Labels

Comments

@pleku
Copy link
Contributor

pleku commented Feb 8, 2021

  • Backport the custom theme feature in a backwards compatible (but forward incompatible) way, by not changing the theme annotation value - instead we add a new parameter to it:
@Theme(themeFolder="foobar")

this means that we make the default value be Lumo.class.

What this implies is that:

 @Theme(value=Lumo.class, themeFolder="foobar") // this would be the same as the default

// the following will need throw explaining that the custom theme folder only works with lumo theme
@Theme(value=SomeThingElseThanLumoOrExtendingLumo.class, themeFolder="foobar")
@Theme(value=Material.class, themeFolder="foobar")

// the following will work, given Savu extends Lumo
@Theme(value=Savu.class, themeFolder="foobar")

// because we make Lumo.class the default value, it will be possible to just add the annotation and that should fail because it is an user error
@Theme // this should throw, asking for specifying the custom theme folder
  • If someone tries using @Theme(themeFolder="foobar") when in compatibility mode, we should throw an error noting that custom themes don't' t work in compatibility mode
  • Backport the documentation, and note there that:
    • This feature only works for npm-mode, NOT in compatibility mode
    • This feature is available since 14.6 and 19
    • For version 19+ the theme annotation is changed so that the custom folder is the value parameter
  • The SVC templates should be updated to use this feature for v14.
  • The theme demo app should get another branch with v14.6 in use
  • update the project used for PiT to use 14.6

If there are things that are only applicable for fusion projects, like maybe #9842, those don't have to backported to 14.
Adding the custom theme feature should not regress the frontend build time for v14. The plugins should not be applied when the custom theme folder is not in use.

@caalador
Copy link
Contributor

Having an empty Theme annotation will work the same way as not having a Theme annotation in the application and lead to usage of the default theme if it's available on the classpath

caalador added a commit that referenced this issue Mar 3, 2021
Throw exception if improved theme support is
used in compatibility mode.

Part of #9983
pleku pushed a commit that referenced this issue Mar 4, 2021
Throw exception if improved theme support is
used in compatibility mode.

Part of #9983
@pleku
Copy link
Contributor Author

pleku commented Mar 5, 2021

Another thing to TODO, update the project used for PiT to use 14.6

@caalador
Copy link
Contributor

caalador commented Mar 5, 2021

Created branch: https://gitlab.vaadin.com/mgrankvi/appthemedx/-/tree/14.6/
Still needs the AppShellConfig removed and theme annotation changed to work with 14 branch.

@caalador
Copy link
Contributor

caalador commented Mar 9, 2021

Note: #9613 adds css loading order tests, and for some reason they load differently under V14.
This will need to be investigated and/or documented after we have all the features in.

  • Investigate and fix loading order.

caalador added a commit to vaadin/docs that referenced this issue Mar 16, 2021
Add the custom theme feature documentation
to v14 branch.

Part of vaadin/flow#9983
caalador added a commit to vaadin/docs that referenced this issue Mar 17, 2021
Add the custom theme feature documentation
to v14 branch.

Part of vaadin/flow#9983
caalador added a commit to vaadin/docs that referenced this issue Mar 17, 2021
Add the custom theme feature documentation
to v14 branch.

Part of vaadin/flow#9983
caalador added a commit to vaadin/docs that referenced this issue Mar 17, 2021
Add the custom theme feature documentation
to v14 branch.

Part of vaadin/flow#9983
caalador added a commit to vaadin/docs that referenced this issue Mar 17, 2021
Add the custom theme feature documentation
to v14 branch.

Part of vaadin/flow#9983
caalador added a commit to vaadin/docs that referenced this issue Mar 17, 2021
Add the custom theme feature documentation
to v14 branch.

Part of vaadin/flow#9983
caalador added a commit to vaadin/docs that referenced this issue Mar 18, 2021
Add the custom theme feature documentation
to v14 branch.

Part of vaadin/flow#9983
caalador added a commit to vaadin/docs that referenced this issue Mar 18, 2021
Add the custom theme feature documentation
to v14 branch.

Part of vaadin/flow#9983
@caalador caalador removed their assignment Jun 10, 2021
@pleku pleku closed this as completed Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants