Problem/Motivation

This issue provides the actual MR to merge Gin into core under the name admin. Detailed tasks and issues can be found over at #3530849: [META] Gin 6.x: Preparation for merging into core.

Test instructions

Use Drupal 11.x and apply the patch from MR!13737. Afterwards, run these commands:

drush pmu toolbar 
drush en -y navigation
drush then admin
drush cset system.theme admin admin
drush thun gin
drush thun claro
drush cr

There are 2 feature flags:

$settings['core_admin_theme_use_sticky_action_buttons'];
$settings['user_login_admin_theme'];

The first one default to never, allowed values are content_forms and always.

The second one defaults to TRUE and can optionally be turned off.

Remaining tasks

Pass all linting
Pass tests

Issue fork drupal-3556948

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

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Issue summary: View changes
jurgenhaas’s picture

Issue summary: View changes
jurgenhaas’s picture

Regarding cspell errors, here is the list of words that are available in settings and javascript, that we should ignore:

apng
backtosite
darkmode
eberhard
endapply
fullscreeneditor
ginter
grossgasteiger
gvar
highcontrastmode
imageapi
imce
lightmode
micha
navigationcreate
pamg
resizer
schwarz
scrollsync
smartdate
syncscroll
tablesaw
tmgmt
toleft
toolsextra
totop
treetable
webform
xxxs

Where should they go?

Or should we ignore CSS, and JS files, and change the names of settings properties?

quietone made their first commit to this issue’s fork.

quietone’s picture

I made a commit of a what I wanted to add as suggestions but GitLab is painfully slow for me so I gave up. The commit includes changes like 'dark mode' instead of 'darkmode' because it is referring to the mode, not the name of the setting. Also, in a few cases I tried to make the distinction between any admin theme and this particular admin theme. Those are user facing and should be checked carefully.

In fact, it is usually confusing what is meant by 'admin' and 'admin theme' in the comments. Is it referring to this particular theme or any administrative theme?

And, I think the doc pages should include an introductory remark for developers that Admin involved from Gin and thus many settings etc use the word 'gin'.

quietone’s picture

Status: Active » Needs review

I get 28 words flagged by cspell. Of those 11 are in the cpp dictionary and one in the css dictionary. That is not enough to consider enabling those dictionaries, not that we would use the C++ dictionary anyway. And using the css one is for another issue. Next, is to consider renaming. I think that improves readability so I would prefer that option. However, js and css are not my area so this needs more opinions are needed. If it helps the discussion I can do the renaming work.

quietone’s picture

I followed the steps in the issue summary after logging in the admin pages result in

Twig\Error\LoaderError: Template "core/themes/admin/templates/navigation/menu--toolbar.html.twig" is not defined in "core/themes/admin/templates/html.html.twig" at line 51. in Twig\Loader\ChainLoader->getCacheKey() (line 51 of core/themes/admin/templates/html.html.twig).
pameeela’s picture

I got the same as #9 but resolved it by uninstalling the Toolbar module. Then you also will want to enable Navigation.

Is it enough just to document that this is needed if you are looking to switch your site over?

pameeela’s picture

Along with general testing, I tested the feature flags and all worked as expected:

  1. Login form defaults to use admin theme
  2. Setting this to false uses Olivero
  3. No sticky actions by default
  4. Setting this to content_only enables them on the node forms
  5. Setting this to always enables this on all forms

Overall I am in awe of the work that has been done on this so quickly @jurgenhaas and @saschaeggi and whoever else was involved in this superhuman effort :)

quietone’s picture

There are instances of "Gin" in comments that I think should now be changed to "Admin". I was making suggestions for those but GitLab was being a bit faster. But then I discovered that it isn't showing all the files in the change. So, I am going to step away from this for now. Maybe tomorrow I will make a commit for those changes.

pameeela’s picture

@quietone indeed the size of this MR makes it quite difficult to work with. I would say that updating references to Gin in comments can be done in a follow up mostly for that reason!

quietone’s picture

Issue summary: View changes

@pameeela, thanks! I've updated the issue summary with that.

I also added remaining tasks to help keep track of things to do

jurgenhaas’s picture

Issue summary: View changes
Status: Needs review » Active

Thanks @pameeela and @quietone for your feedback.

The changes in #14 seem to be missing, though.

I'll work though everything else, including that toolbar issue. And yes, working in follow-ups would make things much easier, but only if we feel comfortable with the initial MR, of course.

I'm wondering, should we add a component "Admin theme" to the core project?

poker10’s picture

Thanks for working on this!

I got the same as #9 but resolved it by uninstalling the Toolbar module. Then you also will want to enable Navigation.
Is it enough just to document that this is needed if you are looking to switch your site over?

I think that it was discussed earlier that Gin will support Toolbar (only the one default position) until it is removed from core. So I think we should fix that error instead of forcing users to use Navigation.

quietone’s picture

Issue summary: View changes

@jurgenhaas, I've updated it again.

quietone’s picture

Component: Claro theme » Admin theme

I'm wondering, should we add a component "Admin theme" to the core project?

I couldn't think of a reason not to, so I did.

jurgenhaas’s picture

Component: Admin theme » Claro theme

The toolbar issue should be resolved. It only occurred when toolbar was enabled AND navigation was disabled.

longwave’s picture

Are we keeping the gin machine name in classes, config, settings keys, etc? There are a lot of references - and changing some of these once this is released will probably be more difficult.

jurgenhaas’s picture

Are we keeping the gin machine name in classes, config, settings keys, etc? There are a lot of references - and changing some of these once this is released will probably be more difficult.

Renaming classes and variables in CSS and JS is something that should be done after the deduplication of Claro components has been completed. That's all the files till remaining in the migration directory having to be merged into the files in the css and js directories. It was agreed that this can be done after merge and Sascha is going to break this into smaller tasks so that more people, and not just him, can work on this.

jurgenhaas’s picture

Component: Claro theme » Admin theme

@quietone 2 threads still open, one of which I can't find the answer to and the other which is taken over from Claro.

Other than that, the following tests are still failing:

  • CSS and JS linting: I'm not sure they can be resolved short term while people will continue working on the deduplication task
  • PHPStan: this is a deprecation from an Ajax trait and needs to be fixed there. Not sure how this failure got handled in other places where this isn't reported
  • PHPUnit with PHP 8.5 is allowed to fail
  • CSpell: there is still the list of words from #5 and I wonder how they should be approached. Changing class names or variable/setting keys should be avoided at this point, and that would even only address part of the problem. Shall we add asset directories of Gin in the .cspell.json?
longwave’s picture

I pushed a commit to update the PHPStan baseline, this is new from Symfony 7.4 and only temporary until #3555532: Since symfony/http-foundation 7.4: Request::get() is deprecated, use properties ->attributes, query or request directly instead. is fixed.

Regarding CSS, if I run yarn build:css I get different build output. Shouldn't any deduplication or other fixes be happening on the .pcss.css files, and the .css files should be machine generated from those? If the .pcss.css and .css differ it feels like something has gone wrong. yarn build:css must run cleanly in case we need to update any other PostCSS files.

For JS we can run yarn lint:core-js-passing --fix to solve most of the formatting problems although there are 40 or so manual fixes to do after that. In the meantime we could skip this by adding to .eslintignore as long as there is a followup to remove it again?

For CSpell ideally we should add cspell:ignore comments to files where the spelling will only appear once (eberhard, grossgasteiger, micha only appear in themes/admin/login/js/wallpaper.js for example). I think some of the others warrant further investigation - I didn't check them all but toolsextra only appears once in a class name, so does this mean it isn't used? Similar tablesaw only appears in the context of .tablesaw-cell-content which is a class name that I don't see in use.

jurgenhaas’s picture

Thank you for the updated baseline @longwave, that's amazing.

As for CSS and JS, I'd leave that to Sascha and others to decide, as I'm not really the expert here.

But I'll look into the spelling details for each of the words to see how many of those we can get rid of, and then review the remaining list which should probably be much shorter.

saschaeggi’s picture

@longwave

For JS we can run yarn lint:core-js-passing --fix to solve most of the formatting problems although there are 40 or so manual fixes to do after that. In the meantime we could skip this by adding to .eslintignore as long as there is a followup to remove it again?

I guess you're referring to the JS inside of migration. We could go either way, but the goal would be to migrate/consolidate those and we'd remove this afterwards.

Regarding CSS, if I run yarn build:css I get different build output. Shouldn't any deduplication or other fixes be happening on the .pcss.css files, and the .css files should be machine generated from those? If the .pcss.css and .css differ it feels like something has gone wrong. yarn build:css must run cleanly in case we need to update any other PostCSS files.

Similar story, where do we get a different build output? Yes, that should be the case. Maybe there was something we didn't pay attention to and it made it's way directly to the .css but that would need to be updated to be included in the .pcss file. For the stuff that is in the migration folder still needs to be migrated, for those we only kept the .css output as it was written in SCSS before (for historical reasons).

berdir’s picture

I'm not exactly sure in which issue I should comment and if I should at all.

I'm a bit concerned about the scope of this (just looking at the PHP code, this might be the biggest code addition since views got into core in a single MR?). There are thousands of lines of preprocess and other hooks. It's not realistic that this is all meaningfully reviewed. I understand that the decision was made and there isn't really an alternative for this initial merge, but still, there is a lot of very opinionated code that contains all kind of customizations and as already discussed, various workarounds for older versions and contrib and so. I added one more comment on a media alter.

I also noticed that the info.yml file hasn't been adjusted yet. I'm not sure if we support the lifecycle definition in themes, but if so, this should probably be experimental? also stuff like package, version and so on.

I saw that the user login theme negotiator issue was closed in favor of this, making this even bigger and also including changes to non-experimental extensions. Do we really need that feature in the initial merge of this?

longwave’s picture

For the JS I've ignored the migration directory via .eslintignore and fixed the issues in core/themes/admin/login/js/wallpaper.js. I've also skipped cspell on the wallpaper filenames while I was there.

@saschaeggi to see the different build output just check out this branch and run yarn build:css from the core directory - a large number of the admin .css files get updated with various changes:

$ yarn build:css
...
$ git diff --shortstat
 48 files changed, 2037 insertions(+), 1987 deletions(-)

If we are shipping both .pcss.css and .css files then the build output must be clean/unchanged before this can be committed, because otherwise the next issue to work on this will not know which is correct.

Note so far I'm only looking at this from the technical point of view to get it to pass CI, I share some of the concerns with @berdir about scope and haven't done any manual testing at all.

jurgenhaas’s picture

Went through all the cspell strings and managed to either ignore them or to rename them. This test is now green.

So, we're down to CSS test being the final one that fails.

jurgenhaas’s picture

I'm now working through the PCSS/CSS diffs and get them sorted.

jurgenhaas’s picture

We're getting close to a green CSS linter test. The CSS files are now all properly checked, and I managed to fix around 1.200 prettier issues semi-automatically.

What's left are 38 prettier issues that are related to colour syntax. This goes beyond my pay grade, that needs to be checked and fixed by an expert.

Regarding the concerns in #26:

The MR is huge, can't argue that. What would have been a better approach to this then?

I saw that the user login theme negotiator issue was closed in favor of this, making this even bigger and also including changes to non-experimental extensions. Do we really need that feature in the initial merge of this?

The reason for handling this change here as well is that none of the two separate MRs would ever pass tests in isolation, that's why they can only come together. And the reasoning for why this is needed in the first place has been quoted from the Slack discussion with @lauriii.

berdir’s picture

> The reason for handling this change here as well is that none of the two separate MRs would ever pass tests in isolation, that's why they can only come together. And the reasoning for why this is needed in the first place has been quoted from the Slack discussion with @lauriii.

What tests? Drupal CMS tests? There are no tests in this MR. I don't think this needs to satisfy Drupal CMS exceptations on day 1. Removed contrib integrations will also need to find a new home, it'll need some new dependencies for that anyway. The discussion with @laurii is on how it should be done, which I agree with, not that it needs to be done and must be included.

I also left some review comments on that part, I really think this needs more scrutiny and careful review (and tests).

jurgenhaas’s picture

To address the concerns about the user module and the special login handling, we've just removed that part from the MR and propose to deal with that afterwards back in the original issue at #3554693: Admin Theme: support admin theme login.

jurgenhaas’s picture

There are 3 functional javascript tests failing, everything else is green. The failures are:

Inline Block (Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlock)
 ✔ Inline blocks
 ✔ No layout save with discard_changes
 ✘ No layout save with revert
   ┐
   ├ TypeError: str_starts_with(): Argument #1 ($haystack) must be of type string, array given
   │
   │ /builds/issue/drupal-3556948/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php:115
   ┴
 ✔ Inline blocks revisioning
 ✔ Inline blocks revisioning integrity
 ✔ Deletion
 ✔ Access
 ✔ Add work flow
 ✔ Add inline blocks permission
 ✔ Edit inline blocks permission
 ✔ Inline block parent revert




Admin (Drupal\Tests\admin\Functional\Admin)
✔ Default admin settings
✔ Dark mode setting
✔ Accent color setting
✔ Focus color setting
✘ User settings
  ┐
  ├ Behat\Mink\Exception\ElementNotFoundException: Button with id|name|label|value "Save" not found.
  │
  │ /builds/issue/drupal-3556948/core/tests/Drupal/Tests/WebAssert.php:159
  │ /builds/issue/drupal-3556948/core/tests/Drupal/Tests/UiHelperTrait.php:75
  │ /builds/issue/drupal-3556948/core/themes/admin/tests/src/Functional/AdminTest.php:123



Entity Filtering Theme (Drupal\Tests\system\Functional\Theme\EntityFilteringTheme)
 ✘ Themed entity
   ┐
   ├ Behat\Mink\Exception\ExpectationException: Current response status code is 500, but 200 expected.
   │
   │ /builds/issue/drupal-3556948/vendor/behat/mink/src/WebAssert.php:888
   │ /builds/issue/drupal-3556948/vendor/behat/mink/src/WebAssert.php:145
   │ /builds/issue/drupal-3556948/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php:161
   ┴

1 test triggered 2 deprecations:

1) /builds/issue/drupal-3556948/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:52
'page' is deprecated in drupal:11.3.0 and is removed in drupal:13.0.0. Use 'view_mode' instead. See https://www.drupal.org/node/3458593

Triggered by:

* Drupal\Tests\system\Functional\Theme\EntityFilteringThemeTest::testThemedEntity (2 times)
  /builds/issue/drupal-3556948/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php:145

2) /builds/issue/drupal-3556948/core/lib/Drupal/Core/Test/HttpClientMiddleware/TestHttpClientMiddleware.php:52
'page' is deprecated in drupal:11.3.0 and is removed in drupal:13.0.0. Use 'view_mode' instead. See https://www.drupal.org/node/3542527

Triggered by:

* Drupal\Tests\system\Functional\Theme\EntityFilteringThemeTest::testThemedEntity
  /builds/issue/drupal-3556948/core/modules/system/tests/src/Functional/Theme/EntityFilteringThemeTest.php:145

I've tried everything that came to mind, I can't figure out what's wrong with them. Any help would be much appreciated.

berdir’s picture

The page deprecation is https://www.drupal.org/node/3458593, you need to update your node templates to not check for page.

jurgenhaas’s picture

I've rebased the MR to also contain the security fixes from last night. One of the 3 test failures disappeared. The first test failure is a missing "Save" button that I can't reproduce.

The page deprecation is https://www.drupal.org/node/3458593, you need to update your node templates to not check for page.

For that one, we would appreciate a hint on what might be wrong in the templates, @berdir. We've checked but could figure out what exactly would have to be changed.

berdir’s picture

See https://git.drupalcode.org/project/drupal/-/commit/685ad2ba89418998c5912.... You need to stop checking the page variable in your node and term twig templates and look at the view mode instead (which you copied from classy)

catch’s picture

Status: Active » Needs work

Not sure what the process is for changes in Claro, but #2409559: User should be able to identify required fields from field listing added new CSS to Claro for manage fields which will likely need to be copied over/adapted.

lauriii’s picture

What are the next steps on this issue? It would be great to get this committed early in the release cycle.

jurgenhaas’s picture

@lauriii I was planning to pick this up over the holiday period and get it ready for review by end-of-year or first week January.

jurgenhaas’s picture

Version: 11.x-dev » main

Rebased the MR against main and changed the version here.

jurgenhaas’s picture

  • Rebased MR
  • Forward ported fixed issues from maintenance in Gin 5
  • Fixed node and taxonomy templates following #36 from @berdir
  • Copied CSS from Claro as of #37 from @catch
  • Fix CSS lint errors

All tests are green except for that one I mentioned before, @berdir your suggestion didn't help I'm afraid.

catch’s picture

There are a couple of other CSS commits to Claro since November, e.g.:

commit 929caa86a96916d200855ed3aa66991e0f749133
Author: Dave Long <dave@longwaveconsulting.com>
Date:   Thu Jan 22 14:12:43 2026 +0000

    task: #3565630 Existing Safari workarounds for details element seems to be no longer needed
    
    By: tom konda
    By: smustgrave
    (cherry picked from commit fb0bd735ac169cc2fa8faa3d6dba133fbe8432d5)

commit 253937064d90a0477b5b12e2f49554518ef3bbc1
Author: Dave Long <dave@longwaveconsulting.com>
Date:   Thu Jan 22 10:19:15 2026 +0000

    feat: #3521857 Update Drupal's default file type icons to use SVG
    
    By: jwilson3
    By: smustgrave
    By: mgifford
    (cherry picked from commit 794c6dee90ef848e65603a65e5f10c17236c5294)

Not sure whether these are relevant or not at this point, but in case they are.

lauriii’s picture

phenaproxima made their first commit to this issue’s fork.

phenaproxima’s picture

Status: Needs work » Needs review

Fixed the last failing test.

The bug was due to a line that dates back to 2012 🤯 in the test, which creates a term whose vid is 1.

1?

Vocabulary IDs haven't been serial since Ye Anciente Times. How did this test ever pass? No idea. (I was there, Gandalf. I was there on that day 3,000 years ago...)

Anyway, creating an actual vocabulary and a term assigned to it (via TaxonomyTestTrait) corrects the problem. Commit: https://git.drupalcode.org/project/drupal/-/merge_requests/13737/diffs?c...

mgifford’s picture

@phenaproxima what about all of these? https://www.drupal.org/project/gin/issues/3506302

Accessibility still matters in Core.

phenaproxima’s picture

I have no opinion on that...? I was asked by @pameeela to resolve the failing test, so I did. If more things need doing in Gin before this is ready to go, so be it.

jurgenhaas’s picture

Thank you so much @phenaproxima for finding that issue with the test and fixing it. I've looked through the MR once again, and it's now ready for review.

catch’s picture

@mgifford at least some of those issues also affect Claro, such as #3497077: dropdown buttons are broken with Javascript disabled. The split between Claro and Gin is IMO responsible for the lack of development of Claro in core as well as those accessibility issues building up in Gin over time.

The process of bringing Gin into core and unforking the themes (even though initially we'll have essentially three admin themes instead of two, we'll rapidly move towards the point of having one) should mean a lot more focus and attention goes into fixing them, the review that has happened since Gin was added to Drupal CMS has already improved things a lot.

pameeela’s picture

Status: Needs review » Reviewed & tested by the community

Strongly agree with @mgifford that accessibility matters in core, and also with @catch that merging this will get more attention on those issues, in addition to reducing the duplication of effort across multiple admin themes.

Incredible effort by @jurgenhaas to get this ready and many thanks to @phenaproxima for chasing down those last tests!

kentr’s picture

Does this pass the core accessibility gate?

  • lauriii committed 9fc3187d on main
    feat: #3556948 Merging Gin as Admin theme
    
    By: jurgenhaas
    By: quietone...

lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Experimental themes (and modules) do not have to comply with core gates or be feature complete. The purpose of alpha experimental stage is to get initial reviews and start creating plans for feature completion and stability. For more information on the experimental process, you can refer to https://www.drupal.org/about/core/policies/core-change-policies/experime....

I discovered some small things that immediately jumped out as something that we need to improve. I will be filing follow-ups for those since it's easier to handle them in separate issues. I've committed this as alpha experimental to make the development easier.

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.

kentr’s picture

Experimental themes (and modules) do not have to comply with core gates or be feature complete. The purpose of alpha experimental stage is to get initial reviews and start creating plans for feature completion and stability.

@lauriii Thanks!

FYI: It doesn't appear in the UI as experimental, and installing it doesn't give a warning.

mherchel’s picture

@kentr if that's the case, we need a followup. Should be an easy fix.

Congrats everyone!

acbramley’s picture

It's probably a bit too late now, but I wish something this big would have had a bit more of a consensus with the community on naming.

Myself and at least a half dozen other contributors/maintainers (as seen in slack) aren't big fans of the machine name admin

To me, this is a strange decision. Even if we're moving towards a single admin theme in core, the name admin just makes it difficult and confusing to talk about.

Grepping code and finding admin theme specific things also becomes a lot harder...

xmacinfo’s picture

I agree. And I agree with all the reasons.

The rightful name of the Admin theme should be:

Core theme

Shall we open an issue?

catch’s picture

The general idea here is to try to centralise everything in a single admin theme across both core and contrib since duplication causes a lot of problems when trying to develop new administrative UIs. We would not prevent people from creating admin themes obviously, but we'll remove the selection in the UI and core features will work with the 'admin theme', and anything else will need to keep up etc. Just calling it 'admin' is a nod to that.

Having said that, opening an issue to change the name again seems fine - if we come up with something better that's great and should be a find and replace while it's still alpha.

pameeela’s picture

No issue with changing the name either. “Core theme” strikes me as even more problematic though!

joachim’s picture

Have the accessibility and JS-degradation issues been fixed yet?

damienmckenna’s picture

I opened #3576646: Rename Gin-based admin theme for the discussion around renaming the theme.

  • longwave committed 81ac7ad4 on 11.x authored by lauriii
    feat: #3556948 Merging Gin as Admin theme
    
    By: jurgenhaas
    By: quietone...
eduardo morales alberti’s picture

Congratulation!!

gábor hojtsy’s picture

Maintainers were not added to all the places. Opened #3578745: Add maintainers of Admin theme to MAINTAINERS.txt.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.