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

Created on 30 April 2019, about 6 years ago
Updated 30 January 2023, over 2 years 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

10.1

Component
System 

Last updated about 10 hours ago

No maintainer
Created by

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

Merge Requests

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.71.5 2024