Change Selected Background Color #423
-
How do you change the background color of an selected option in Slim Select. I would like to change it to light green but I cannot figure this out. This is my code below. When inspecting the elements, it will seem .ss-selected is the class that gives the selected options that light blue color.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
https://codepen.io/brianvoe/pen/qByjoao Slim Select uses css variables, so you can change the color that way. Slim Select has two primary classes you can see in the src code and that is .ss-main and .ss-content everything sub of should be easily targetable. You can always open inspect element and see what classes are being applied. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
Here is my code so far. And what is strange is that --ss-bg-color will change the background color of an option and the font color of an selected option. Also .myOptionClass does not fully work as it only changes the font color of Option 2 when Option 2 is selected and will not change the background color at all.
|
Beta Was this translation helpful? Give feedback.
-
css variables overrides work a little different for css variables. You will need to wrap it in a
|
Beta Was this translation helpful? Give feedback.
https://codepen.io/brianvoe/pen/qByjoao
Slim Select uses css variables, so you can change the color that way.
Slim Select has two primary classes you can see in the src code and that is .ss-main and .ss-content everything sub of should be easily targetable.
You can always open inspect element and see what classes are being applied.
Hope this helps.