Skip to content

Commit

Permalink
Replaced ambientimpact_base Gin core Navigation dark mode with patch:
Browse files Browse the repository at this point in the history
See https://www.drupal.org/project/gin/issues/3488177

- Upgrading drupal/ambientimpact_base (7.x-dev 3a1232b => 7.x-dev 1b63b19)
  • Loading branch information
Ambient-Impact committed Nov 18, 2024
1 parent a2833a9 commit 5d3561d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 5 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@
"Slow admin/config page load [#3336621]: https://www.drupal.org/project/drupal/issues/3336621#comment-14888211": "patches/drupal/core/3336621-3-remove-admin-config-status-report-check.patch",
"Drupal.displace() only checks inline display: none; instead of computed styles, leading to incorrect visibility check [#3487907]: https://www.drupal.org/project/drupal/issues/3487907": "patches/drupal/core/3487907-drupal-displace-computed-style.patch"
},
"drupal/gin": {
"New core navigation's top bar in dark mode on small screens has white background with light grey text [#3488177]: https://www.drupal.org/project/gin/issues/3488177": "patches/drupal/gin/3488177-core-navigation-dark-mode-top-bar.patch"
},
"drupal/image_style_warmer": {
"Support webp images [#3319397]: https://www.drupal.org/project/image_style_warmer/issues/3319397#comment-14802527": "patches/drupal/image_style_warmer/webp-module-support-3319397-5.patch"
},
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions patches/drupal/gin/3488177-core-navigation-dark-mode-top-bar.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/dist/css/layout/core_navigation.css b/dist/css/layout/core_navigation.css
index 1fa8c48e..6e32aca6 100644
--- a/dist/css/layout/core_navigation.css
+++ b/dist/css/layout/core_navigation.css
@@ -38,7 +38,7 @@ body.gin--core-navigation {
}
}

-.admin-toolbar {
+[data-drupal-admin-styles] {
--admin-toolbar-font-family: var(--gin-font);
--admin-toolbar-color-white: var(--gin-bg-layer);
--admin-toolbar-color-gray-050: var(--gin-bg-layer2);
@@ -54,6 +54,10 @@ body.gin--core-navigation {
inset-block-start: 0;
}

+.gin--core-navigation .admin-toolbar-control-bar {
+ background-color: var(--admin-toolbar-color-white);
+}
+
.gin--core-navigation .gin-secondary-toolbar:not(.gin-secondary-toolbar--frontend) {
margin-block-end: var(--gin-spacing-xxs);
}
diff --git a/styles/layout/core_navigation.scss b/styles/layout/core_navigation.scss
index 09c88872..6099edc5 100644
--- a/styles/layout/core_navigation.scss
+++ b/styles/layout/core_navigation.scss
@@ -40,7 +40,8 @@ body.gin--core-navigation {
}
}

-.admin-toolbar {
+// This applies to both the sidebar and the control bar on small screens.
+[data-drupal-admin-styles] {
--admin-toolbar-font-family: var(--gin-font);
--admin-toolbar-color-white: var(--gin-bg-layer);
--admin-toolbar-color-gray-050: var(--gin-bg-layer2);
@@ -60,6 +61,12 @@ body.gin--core-navigation {
inset-block-start: 0;
}

+// Core currently hard codes this as 'white' rather than a custom property, so
+// we need to fix that to correctly apply dark colours.
+.gin--core-navigation .admin-toolbar-control-bar {
+ background-color: var(--admin-toolbar-color-white);
+}
+
.gin--core-navigation .gin-secondary-toolbar:not(.gin-secondary-toolbar--frontend) {
margin-block-end: var(--gin-spacing-xxs);
}

0 comments on commit 5d3561d

Please sign in to comment.