- Issue created by @trackleft2
- ๐บ๐ธUnited States michaellander
Thanks for creating the issue! For anyone interested, I put some of this in โจ Support for core navigation experimental module Needs work .
However, I stopped short of adding it for non-active environments. Was looking for more feedback!
- ๐บ๐ธUnited States trackleft2 Tucson, AZ ๐บ๐ธ
@michaellander I think your idea definitely has merit and should be implemented across the board. +1 from me.
- Merge request !58Draft: Initial commit fixes flash of unstyled content and the issue where the toolbar... โ (Open) created by trackleft2
- ๐บ๐ธUnited States trackleft2 Tucson, AZ ๐บ๐ธ
In my initial merge request I eliminate the need for Javascript to set the
background-color
andcolor
style properties of the toolbarnav
element.This is done by adding a
data-attribute
to the toolbarnav
element if the toolbar integration is enabled, and then targeting that element via CSS in a new toolbar specific library.This fixes the Flash before js issue.
It also inadvertently fixes the issue where the toolbar is colored even if the toolbar integration is disabled.Next we can work on how those switchers work.
- ๐บ๐ธUnited States michaellander
Nice work! For the switchers, we could probably just use
Drupal\Component\Utility\Html::getClass()
on the environment label to generate a wrapper class name, and use that class to switch the variable values in a given context. Could always wrap the name generation in a utility function/method?:root { --environment-indicator-bg-color: blue; } .environment-indicator--production { --environment-indicator-bg-color: red; } .environment-indicator--develop { --environment-indicator-bg-color: green; }
Thoughts?
- ๐บ๐ธUnited States trackleft2 Tucson, AZ ๐บ๐ธ
I was able to style the environment switchers using CSS variables in the most recent version of the open merge request.
I think there is still an issue with the non-toolbar version of the indicator's environment indicator switcher dropdown.