Problem/Motivation
Drupal 12 ships a Gin based admin theme in core, called Default Admin. The widget only looked for the Gin contrib theme, so on the core admin theme it fell back to the plain styling and lost the tag look. The Gin stylesheet also depended on the --gin-* custom properties being there, with no fallback for the day the core theme renames or drops them.
Steps to reproduce
- Install Drupal 12 and keep the Default Admin theme.
- Open a form with an Autocomplete Deluxe field.
- The Gin styling is not attached and the tags fall back to the plain look.
Proposed resolution
Detect the Gin contrib theme and the core Default Admin theme, and their subthemes, in one place. Give every custom property in the Gin stylesheet a fallback value, move the tag rules to logical properties so right to left follows on its own, and draw the throbber with an animation rather than a background image. The theme detection moves into a small static helper so it can be unit tested without the theme system, and the module also declares Drupal 12 support.


Remaining tasks
- ✅ File an issue
- ✅ Addition/Change/Update/Fix
- ✅ Testing to ensure no regression
- ✅ Automated unit testing coverage
- ➖ Automated functional testing coverage
- ➖ UX/UI designer responsibilities
- ✅ Readability
- ➖ Accessibility
- ➖ Performance
- ➖ Security
- ➖ Developer Documentation
- ➖ User Guide Documentation
- ➖ Reviewed by human
- ➖ Code review by maintainers
- ➖ Full testing and approval
- ➖ Credit contributors
- ➖ Review with the product owner
- ➖ Release notes snippet
- ❌ Release
User interface changes
- The tag styling follows the Gin contrib theme and the Drupal 12 Default Admin theme alike, in both writing directions.
API changes
- The help hook moves to an object oriented hook class, with the procedural function kept as a legacy wrapper for Drupal 10 and 11.0.
- The field widget plugin moves from an annotation to the PHP attribute.
Data model changes
- N/A
Release notes snippet
- Autocomplete Deluxe styles its tags under the Drupal 12 Default Admin theme as it does under Gin, and declares Drupal 12 support.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | d12-default_admin-autocomplete-deluxe.png | 72.03 KB | rajab natshah |
| #5 | 3591908-gin-widget.png | 57.22 KB | rajab natshah |
Issue fork autocomplete_deluxe-3591908
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
rajab natshahThanks, Mike
Following up.
Comment #4
rajab natshahComment #5
rajab natshahSplit the merge request in two, so the styling change and the test suite are each a review of their own: the browser test suite moved to #3619108: Automated functional testing for Autocomplete Deluxe (2.1.x), and the pipeline itself belongs to #3551487: Setup GitLab CI pipelines. What is left here is the Drupal 12 styling, the hook class and the unit test that covers the theme detection.
Tested on Drupal 11.4: the widget keeps the Gin look with the Gin theme as the admin theme, the tags carry the Gin colours and radius, and the ten theme detection unit tests pass. The Default Admin screenshot from the Drupal 12 build is in the summary.
To review, test, then merge.
Comment #6
rajab natshahComment #7
mherchelHey @rajab natshah
One more thing to take a look at: We've just changed around the CSS variable names in 11.4.4. Documentation is below, but should be straightforward to get it to properly support dark mode.
https://www.drupal.org/docs/core-modules-and-themes/core-themes/default-...
Comment #8
rajab natshahThanks, Mike for the tip.
Sure thing, we are following with that ( we have to add the support to all modules )
Comment #9
rajab natshahComment #11
rajab natshahComment #13
rajab natshah