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
Element API Style doesn't work with CSS values with !important #11981
Labels
Comments
pleku
added this to Needs triage
in OLD Vaadin Flow bugs & maintenance (Vaadin 10+)
via automation
Oct 5, 2021
pleku
moved this from Needs triage
to New P2
in OLD Vaadin Flow bugs & maintenance (Vaadin 10+)
Oct 5, 2021
pleku
changed the title
Element API Style doesn't work with CSS values with !imporant
Element API Style doesn't work with CSS values with !important
Oct 5, 2021
This can be worked around with instead introducing a class name + css that targets the class name (and e.g. optionally a tag) and sets the important style instead. |
denis-anisimov
moved this from New P2
to WIP
in OLD Vaadin Flow bugs & maintenance (Vaadin 10+)
Oct 12, 2021
denis-anisimov
pushed a commit
that referenced
this issue
Oct 12, 2021
9 tasks
OLD Vaadin Flow bugs & maintenance (Vaadin 10+)
automation
moved this from WIP
to Closed
Nov 4, 2021
pleku
added a commit
that referenced
this issue
Nov 4, 2021
fixes #11981 Co-authored-by: Denis Anisimov <denis@vaadin.com> Co-authored-by: Pekka Hyvönen <pekka@vaadin.com>
vaadin-bot
pushed a commit
that referenced
this issue
Nov 4, 2021
fixes #11981 Co-authored-by: Denis Anisimov <denis@vaadin.com> Co-authored-by: Pekka Hyvönen <pekka@vaadin.com>
vaadin-bot
pushed a commit
that referenced
this issue
Nov 4, 2021
fixes #11981 Co-authored-by: Denis Anisimov <denis@vaadin.com> Co-authored-by: Pekka Hyvönen <pekka@vaadin.com>
This ticket/PR has been released with platform 14.7.4. |
This ticket/PR has been released with platform 21.0.4. |
This ticket/PR has been released with platform 22.0.0.beta2 and is also targeting the upcoming stable 22.0.0 version. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is sometimes necessary to override existing component/element CSS or making sure that some important CSS is not easily/accidentally overridden by others.
Reproducing
getElement().getStyle().set("display", "contents !important");
Expected:
Inlined CSS for the element has
Actual:
Inlined CSS for the element has nothing set for
display
.Caused likely by this code https://github.com/vaadin/flow/blob/master/flow-client/src/main/java/com/vaadin/client/flow/binding/SimpleElementBindingStrategy.java#L750
As the API in DOM for adding
!important
for any value is https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/setProperty e.g.The text was updated successfully, but these errors were encountered: