Closed (fixed)
Project:
Environment Indicator
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Nov 2021 at 11:06 UTC
Updated:
31 May 2022 at 09:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
3liCreated a patch to improve the look.
Comment #3
3liAlso can colour the default icon based upon the background colour, idea from #3156863.
Comment #4
3liResolving an issue that caused extra space on the vertical style making it harder to hover over to the sub menu items.
Comment #5
3liComment #6
dpacassiUsing the patch mentioned in #4, can confirm that everything works with Drupal 9.3.0 and that the additional spacing is indeed quite nice.
Comment #7
giuseppe87 commented+1 to the patch, it's much easier to understand the enviroment.
Comment #8
idiaz.roncero+1 to this. Works perfect with 4.x-dev branch.
Comment #9
3liMarking this as RTBC based on the above comments.
Comment #10
jrbFYI, you can also change the entire Gin color scheme in a
settings.local.phpfile along with (or instead of) this patch. For example, we use something like this for our local dev environments:To also change the Gin color scheme locally, you could add this:
The
preset_accent_colorcolor options are:So, in production, you could use the red scheme like this:
While on a staging server, you could use blue:
Comment #11
idiaz.ronceroSorry to say the problem is back with latest Gin 3.x-dev version
Comment #13
idiaz.ronceroI've created a MR that integrates the solution from patch #4 and slightly modifies the logic. The backgroundColor joins the text and will be only used when GIN is not active:
This works as a quick-and-easy solution.
For a perfect solution, I think including all of this logic inside "environment-indicator.js" should be avoided. If every admin theme will need to add its own lines of code inside that file order to support their quirks, we will end up with an unmaintainable file prone to bugs.
Also, checking the body classes (
$('body').hasClass('gin--vertical-toolbar') && !$('body').hasClass('gin--horizontal-toolbar')) is prone to regressions as gin maintaniners could change them anytime.I think a better solution could be to check for the admin theme name on a
hook_preprocess_pageorhook_attachments_alteror similar and conditionally load a custom library (environment_indicator/gin) that will include just the CSS and JS needed for Gin to work with Environment Indicator. This way, we could:Comment #14
dpacassiThanks @idiaz.roncero!
I can confirm that the new MR5 works just fine with the latest releases of Gin, Gin Toolbar and Environment Indicator.
Adding a patch file in case that the MR would get updated.
Comment #15
dpacassiComment #16
e0ipsoComment #18
e0ipso