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

  1. Install Drupal 12 and keep the Default Admin theme.
  2. Open a form with an Autocomplete Deluxe field.
  3. 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.

The widget under the Drupal 12 Default Admin theme

The widget under the Gin theme on Drupal 11

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.
Command icon 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

mherchel created an issue. See original summary.

rajab natshah’s picture

Thanks, Mike
Following up.

rajab natshah’s picture

Title: Special styles for "Default Admin" theme in Drupal 12 » Support Drupal 12 Default Admin (Gin-in-core) styling and add cross-version tests
rajab natshah’s picture

Assigned: Unassigned » rajab natshah
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new57.22 KB
new72.03 KB

Split 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.

The widget under the Gin theme on Drupal 11

To review, test, then merge.

rajab natshah’s picture

Title: Support Drupal 12 Default Admin (Gin-in-core) styling and add cross-version tests » Support Drupal 12 Default Admin (Gin-in-core) styling
mherchel’s picture

Hey @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-...

rajab natshah’s picture

Status: Needs review » Active

Thanks, Mike for the tip.

Sure thing, we are following with that ( we have to add the support to all modules )

rajab natshah’s picture

Status: Active » Needs review

  • rajab natshah committed dc03fadc on 2.1.x
    feat: #3591908 Support the Drupal 12 Default Admin (Gin-in-core) theme...
rajab natshah’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rajab natshah’s picture

Assigned: rajab natshah » Unassigned