System module template form-element should provide class form-type-<type>

Created on 30 April 2019, about 5 years ago
Updated 23 August 2023, 10 months ago

Problem/Motivation

We wanted to add styling to specific types of fields. for instance all checkboxes. We noticed there was no class for this but there was a javascript class for this. Furthermore, the Classy template does provide this class and it seemed odd that this was not a standard class.

This issue should appear in any Drupal installation that uses a custom theme or any theme that does not override the form-element.html.twig template, for instance, the stark template.

Proposed resolution

The class 'form-type-' ~ type|clean_class, should be added to the template in the system module and possibly in the stable theme.
This could be done by adding 'form-type-' ~ type|clean_class, to the classes variable in the form-element.html.twig templates.

Remaining tasks

1. The patch is ready for review.
2. This patch will need to be reviewed.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
System 

Last updated 2 days ago

No maintainer
Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024