gin login is not picking the right theme

Created on 23 April 2024, about 2 months ago

Problem/Motivation

I wanted to modify the size of the brand logo so I added in my theme scss processor

body.gin-login .user-form-page__user-form img {
    max-height: 60px;// instead of default 40px
}

Debugging why my rule was not applied, I realized that all css but "gin" (although gin admin theme is not announced as a requirement for gin_login) and "gin_login" were coming from the default "claro theme", not my active theme (bootstrap barrio scss). I'm not having the time to investigate further but I can see in code that in gin_login_preprocess_ginlogin there is a call to

  $theme = \Drupal::theme()->getActiveTheme()->getName();
  $variables['site_name'] = \Drupal::config('system.site')->get('name');
  $themeIconPath = theme_get_setting('icon_path', $theme);

Or the default logo displayed is the drupal logo instead of the brand logo that was expected as set in my theme. Sending \Drupal::theme()->getActiveTheme()->getName() to \Drupal::logger() it returns "gin" which is my admin theme, not my front theme. Something wrong here ? Okay for gin attachments that are loaded by _gin_login_gin_is_active() but settings should be picked by the active front theme, not the admin theme. And, why claro ?

(using Drupal 10.2.5, gin_login 2.0.4 patched for random custom images #30, admin theme gin, front theme bootstrap barrio scss)

Steps to reproduce

  • With your browser Inspect stylesheets loaded in "head" section => You'll see core/themes/claro and themes/contrib/gin stylesheets and none of the current active theme.
  • Activate twig debugging and inspect code => html template comes from gin, all others but gin_login come from claro.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France erwangel

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

Comments & Activities

Production build 0.69.0 2024