halfmoonui / halfmoon

Halfmoon is a highly customizable, drop-in Bootstrap replacement. It comes with three built-in core themes, with dark mode support for all themes and components.
https://www.gethalfmoon.com
MIT License
3.04k stars 118 forks source link

Required checkboxes aren't possible with class="required" #91

Open moqmar opened 3 years ago

moqmar commented 3 years ago

I'm using the following code:

<div class="custom-checkbox">
  <input type="checkbox" id="privacy-accepted" value="yes" required="required">
  <label for="privacy-accepted" class="required">Ich akzeptiere die Datenschutzerklärung</label>
</div>

The red asterisk is missing, but the check mark inside the checkbox is shifted to the right. I have also tried moving the class="required" to the custom-checkbox element, but it doesn't work either.

Am I doing something wrong here or is this just not implemented? I couldn't find an example of this in the docs either.

circlensq commented 3 years ago

I re-implement your code, and it's true, this required label thing is very hard to achieve.