This module allows you to add or remove CSS classes from form elements based on the URL, route name, or form ID. This can be useful for custom styling or to override classes added by other modules.
Adds or removes classes from form elements based on the URL or route name or Form ID. For example if a module doesn't define a unique class for a button, you can add one with this module. You don't have to create a form alter hook for it.
You can also remove any classes that are added via other modules. But be aware as this can result in AJAX errors on forms where a certain button is missing a required class. (For example if you remove the success class from the commerce Add to cart button, it could result to LogicException: The database connection is not serializable errors). So form item class removal should be your last resort during styling.
Ask your assistant about Custom classes
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 2.0.0-alpha1 | Pre-release | 11 | Oct 10, 2026 | ||
| 2.0.x-dev | Dev | 11 | Oct 10, 2026 | ||
| 1.0.0-alpha2 | Pre-release | 10–11 | Oct 10, 2026 | ||
| 1.0.0-alpha1 | Pre-release | 10–11 | Jun 15, 2024 |