cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

how to change the hover background color of the toggle button's Oval and Rectangle using custom CSS

AA_9130612
4-Participant

how to change the hover background color of the toggle button's Oval and Rectangle using custom CSS

how to change the hover background color of the toggle button's Oval and Rectangle using custom CSS, it  can be changed through the properties but when i ON the toggle button, the same hover color applied for the ON mode also, which creating issues, can we have different hovers for the OFF and ON mode of the toggle button. please provide me the CSS code for this

ACCEPTED SOLUTION

Accepted Solutions
PEHOWE
17-Peridot
(To:AA_9130612)

@AA_9130612 

Here is some CSS which will adjust some attributes of the toggle button. I am not sure I have gotten the item you are looking to adjust. Let me know if you need more.

/* adjust label text color and backgroud and border */
.widget-ptcstogglebutton::part(label) {
    background: orange;
    border-color: red;
    border-width: 4px;
    color: green;
}
/* Set background of toggle button */
.widget-ptcstogglebutton::part(rectangle) {
    background: orange;
    border-color: green;
    border-width: 4px;
}
/* set color of dot in slide */
.widget-ptcstogglebutton::part(oval) {
    background: fuchsia;
}
/* adjust toggle when checked */
.widget-ptcstogglebutton:not([disabled])[checked]::part(rectangle) {
    background: greem;
    border-color: yellow;
    border-width: 4px;
}

View solution in original post

2 REPLIES 2
PEHOWE
17-Peridot
(To:AA_9130612)

@AA_9130612 

Here is some CSS which will adjust some attributes of the toggle button. I am not sure I have gotten the item you are looking to adjust. Let me know if you need more.

/* adjust label text color and backgroud and border */
.widget-ptcstogglebutton::part(label) {
    background: orange;
    border-color: red;
    border-width: 4px;
    color: green;
}
/* Set background of toggle button */
.widget-ptcstogglebutton::part(rectangle) {
    background: orange;
    border-color: green;
    border-width: 4px;
}
/* set color of dot in slide */
.widget-ptcstogglebutton::part(oval) {
    background: fuchsia;
}
/* adjust toggle when checked */
.widget-ptcstogglebutton:not([disabled])[checked]::part(rectangle) {
    background: greem;
    border-color: yellow;
    border-width: 4px;
}
abjain
15-Moonstone
(To:PEHOWE)

@AA_9130612 :If the previous response answered your question, please mark it as the Accepted Solution.

Announcements


Top Tags