Custom css gin-custom.css not loading if gin is not the admin theme

Created on 3 April 2025, about 1 month ago

Problem/Motivation

As said in the title, gin-custom.css file is not loading if gin is not the admin theme. This creates a dependency to gin theme which is not declared anywhere and I think such a dependency is useless. One may like gin_login for itself.

Steps to reproduce

  1. Set gin as your admin theme
  2. Make some changes in gin-custom.css to improve the login page look.
  3. Set claro as you admin theme and refresh the login page => your changes are lost

Proposed resolution

I see three solutions:

  1. Put the login related css rules in the usual custom css file but I'm not sure they will be read by gin_login
  2. Either use an independent gin-login-custom.css and load it with a custom hook_page_attachments_alter
  3. Or remove the if (_gin_login_gin_is_active()) test (it checks if gin is the admin theme) in gin_login_page_attachments_alter()
  function gin_login_page_attachments_alter(&$page) {
    if (_gin_login__check_path()) {
      if (_gin_login_gin_is_active()) {
       // Get theme configs.
      ...

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇫🇷France erwangel

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

Comments & Activities

  • Issue created by @erwangel
  • 🇨🇭Switzerland saschaeggi Zurich

    The gin-custom can only be used when Gin is set as admin theme, that's by design as Gin serves the logic for the gin-custom.css file.

    I'm closing this as works as designed.

    Cheers!

Production build 0.71.5 2024