Okay I experimented a bit and found that you can use it as is, copy and paste, if you use an html element object instead of a button/checkbox object.
Example here - dropbox.com/scl/fi/bxzdcams8yok369489fss/csstoggleexample.c3p
The way they have it set up is that they use a <span> element nested in the <input type="checkbox"> element, which is used as a flexible empty element for the visual shape and animation. You unfortunately can't do this with the built in button object, since you can only put text in that and not other html elements, and the css wizardry involved in making the animation don't work on the checkbox element itself (afaik anyways, might be worth experimenting with later). That's why in the linked example they just hide the checkbox, and use a visible <span> as a toggle switch.
That said, it does work as an HTML element. The problem is that you lose the button conditions - namely "Compare text" and "Is checked", and the actions "Set text" "Set checked" and "Toggle checked". I'd say this is mostly manageable, as you can use/compare a boolean instance variable on the html element as a condition, and similarly another instance variable to compare text. The HTML element has the "On clicked" and "On CSS animation ended" conditions, which should be sufficient for most use cases (use those to set the boolean instance variable to true or false).
I'll try some more things to see what I can do with the button object. I just learned that for checkbox type buttons in particular, the "Set CSS style" action applies the css to the <label> parent element, while the class property in the layout editor is applied actual <input type="checkbox"> element. However, you can also use the "Set attribute" action to give the <label> a class as well. The normal button doesn't have this quirk at all, since it doesn't generate nested elements and is just an <input type="button"> by itself.
Ps - Thanks again to the Construct team for implementing css and html support, it really opens up a lot of possibility for some slick UI implementations, which a lot of users ask for. Too bad it's not particularly accessible for those not really familiar with CSS, and also the minor issue of not having control of the structure of element nesting (mostly solved by having the HTML object now, but then we don't get the ACEs for the form elements as above).