openeuropa / oe_theme

Drupal 10 theme based on the Europa Component Library (ECL).
European Union Public License 1.2
31 stars 31 forks source link

Impossible to extend classes for input type checkbox #1335

Open LOBsTerr opened 12 months ago

LOBsTerr commented 12 months ago

Checkbox component is missing drupal classes like "form-checkbox", this class can be used by some modules to target checkboxes. As result we are missing some UI interactions. The class on the input is hardcoded "ecl-checkbox__input" and we can't change it.

  <input
    id="{{ _id }}"
    name="{{ _name }}"
    class="ecl-checkbox__input"
    type="checkbox"
    value="{{ _value }}"
    {{ _disabled ? "disabled" }}
    {{ _checked ? "checked" }}
    {{ _helper_id is not empty ? "aria-describedby=\"" ~ _helper_id ~ "\"" }}
    {{ _extra_input_attributes|raw }}
  />

It would be great to us the same approach, which is used for a wrapper to allow to extend classes:

<div class="{{ _css_class }}"{{ _extra_attributes|raw }}>