Lun Leong
Lun Leong

Reputation: 61

How to change the color of [part="toggle-button"] in the vaadin-select?

My question is: How to change the custom color of [part="toggle-button"] in the vaadin-select?

I've searched how to change it but I cannot get it too. Please help and solve it, thank you!

Upvotes: 0

Views: 295

Answers (1)

Iosif Mocanu
Iosif Mocanu

Reputation: 63

Just facing with this problem. After some investigations in inspect mode in browser, I found this solution which works for me:

CssImport(value = "./views/your.css", themeFor = "vaadin-checkbox")
class YourViewClass  extends Div {

}

And in your.css file add this:

:host(.toggle-button[checked]) [part='checkbox'] {
    background-color: your-color-code-here;
}

Upvotes: 0

Related Questions