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

Not able to override the nested shadow dom elements using the part selector #6702

Open
Mehafooz opened this issue Oct 9, 2024 · 4 comments
Labels
V14 only Issue is only valid for Vaadin 14

Comments

@Mehafooz
Copy link

Mehafooz commented Oct 9, 2024

Description of the bug

With old vaadin date picker there are nested shadow dom , so im able to override the first level of shadow dom , but not able to override the nested shadow dom
image

image

image

Expected behavior

how to override the nested shadow doms using if they are exposed by parts

Minimal reproducible example

it is reproducable using v14

Versions

  • Vaadin / Flow version:14
  • Java version:
  • OS version:
  • Browser version (if applicable):
  • Application Server (if applicable):
  • IDE (if applicable):
@mcollovati mcollovati transferred this issue from vaadin/flow Oct 9, 2024
@web-padawan
Copy link
Member

Making this work properly would require adding exportparts attribute on the internal text-field which is technically a new feature.

Also note that ::ng-deep isn't going to work with Shadow DOM (it's an Angular specific selector).

@Mehafooz
Copy link
Author

Mehafooz commented Oct 9, 2024

Hi @web-padawan , Im using this date picker in my angular app , using ng deep im able to override the css of the shadow dom but nested shadow dom im not able to override , so im i missing something

@web-padawan
Copy link
Member

In more recent versions (Vaadin 22 - 24) this isn't necessary since we updates vaadin-date-picker to not use vaadin-date-picker-text-field internally. Consider upgrading to any of these and then you'll be able to use CSS like this:

vaadin-date-picker::part(input-field) {
  background-color: red;
}

Styling nested shadow DOM with ::part() is generally not supported without exportparts as described in this issue vaadin/web-components#1051. We don't have plans to add that attribute in Vaadin 14.

@web-padawan web-padawan added the V14 only Issue is only valid for Vaadin 14 label Oct 9, 2024
@Mehafooz
Copy link
Author

Mehafooz commented Oct 9, 2024

So when i use vaadin 22 ,it has a dependency of lumo styles version 24.x.x ,but i have another library that has dependency of lumo style 1.6.1 bcz that im getting this issue vaadin/web-components#7956

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V14 only Issue is only valid for Vaadin 14
Projects
None yet
Development

No branches or pull requests

2 participants