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

Add HasStyle interface to CookieConsent #2855

Closed
web-padawan opened this issue Mar 14, 2022 · 1 comment · Fixed by #2929
Closed

Add HasStyle interface to CookieConsent #2855

web-padawan opened this issue Mar 14, 2022 · 1 comment · Fixed by #2929
Assignees
Labels
enhancement New feature or request papercuts "Services Papercuts" project

Comments

@web-padawan
Copy link
Member

web-padawan commented Mar 14, 2022

Description

  1. Add missing HasStyle interface to CookieConsent
  2. Add unit tests to check the interface - example
  3. Override methods to set classes on the actual element

Part of vaadin/platform#2801

See also

@web-padawan web-padawan added enhancement New feature or request papercuts "Services Papercuts" project labels Mar 14, 2022
@web-padawan web-padawan self-assigned this Mar 22, 2022
@web-padawan
Copy link
Member Author

web-padawan commented Mar 23, 2022

The problem with CookieConsent is that some classes are set on the element when initialization:

consent

Presumably, Java users would expect to be able to remove some of these, especially to control appearance:

consent.removeClassNames("cc-top");
consent.addClassName("cc-bottom");

So we would need to initialize the class list on the Java side to match the actual state of that div.

However, I don't think we can safely set classes on the vaadin-cookie-consent element in this case.
The reason is that host element is hidden with display: none so any CSS class can override it.

This is different for vaadin-overlay which uses display: none !important to hide itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request papercuts "Services Papercuts" project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant