[Bug] Checkbox render with inner padding in Pale Moon browser

When trying out Wolfery in the Pale Moon browser to ensure using div instead of button element for badges helped resolve the button nesting issue, I noticed that checkboxes rendered with an unexpected inner padding when the border is applied:

checkbox_render_pale_moon

@Wolfbeast, I guess you can help me with this one?

Otherwise, Wolfery does seem to work quite fine with the browser :smiley:

I’m surprised you’re not using a styled checkbox form element for that. That would likely solve all your problems. (and prevent you from having to manually implement a check/uncheck function with a button and a colored div…)

The reason the “extra padding” is there is because it’s a <button> and those form elements reserve some space for the (accessibility) focus ring (to keyboard-navigate). There’s currently no way to remove that extra spacing, but I can make it an issue to change that behavior if it causes web compat problems and see if I can find a solution since it does get kind of in the way of full styling of those elements.

One reason is that the ToggleBox component (which is what I call it) also supports toggling between multiple states. This would not work with a checkbox that only has two states (or three, counting ‘disabled’). Eg. setting character tags with the GUI:
togglebox_multiestate

Another reason is because I didn’t know you can style checkboxes to that extent :sweat_smile:.

Ah, I see, yeah the multiple selections styling makes sense, although it doesn’t take away f course that you’re still manually processing it :slight_smile:
As a possible solution, I’d suggest you make the <button> completely transparent (and remove the border), and place the border on the <div> that indicates the checked state, instead. That way you’re avoiding trying to construct a single visual control from multiple elements that might not behave as expected when styled, while needing no code changes otherwise.