Check the actual button type that is being used.
https://www.wix.com/corvid/reference/$w.Button.html#style
https://www.wix.com/corvid/reference/$w.Switch.html
A normal button will easily do this for you, however a switch button as you have stated may not be usable with style and therefore not work.
Note
Not all styles can be used on all button designs. To determine which styles work with a specific button design, go to the Button Design panel in the Editor, choose a design, and click Customize Design . The design options that you see in the Button Design panel for your particular button are the styles you can use in your code.