From 6dba0f55cf654f1948c8afa31504c5985f377d65 Mon Sep 17 00:00:00 2001 From: Christophe Jossart Date: Thu, 20 Jun 2024 15:36:05 +0200 Subject: [PATCH] chore(SLB-415): remove !important on sidebar --- apps/cms/composer.json | 3 ++- .../gutenberg_remove-important-sidebar.patch | 16 ++++++++++++++++ packages/drupal/gutenberg_blocks/css/edit.css | 10 ---------- packages/drupal/gutenberg_blocks/src/preview.ts | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 apps/cms/patches/gutenberg_remove-important-sidebar.patch diff --git a/apps/cms/composer.json b/apps/cms/composer.json index 50427ad02..d2860b8d1 100644 --- a/apps/cms/composer.json +++ b/apps/cms/composer.json @@ -102,7 +102,8 @@ "Autosave preview": "./patches/fetch-entity.patch" }, "drupal/gutenberg": { - "Gutenberg enabled hook": "https://www.drupal.org/files/issues/2024-05-07/gutenberg_enabled_hook_3445677-2.patch" + "Gutenberg enabled hook": "https://www.drupal.org/files/issues/2024-05-07/gutenberg_enabled_hook_3445677-2.patch", + "Remove !important from sidebar": "./patches/gutenberg_remove-important-sidebar.patch" } }, "patchLevel": { diff --git a/apps/cms/patches/gutenberg_remove-important-sidebar.patch b/apps/cms/patches/gutenberg_remove-important-sidebar.patch new file mode 100644 index 000000000..643923a03 --- /dev/null +++ b/apps/cms/patches/gutenberg_remove-important-sidebar.patch @@ -0,0 +1,16 @@ +diff --git a/css/claro.css b/css/claro.css +index 720c3a8..9c5ad05 100644 +--- a/css/claro.css ++++ b/css/claro.css +@@ -44,8 +44,8 @@ + + @media screen and (min-width: 85.375rem) { + .interface-complementary-area.edit-post-sidebar { +- width: 380px !important; ++ width: 380px; + } + } + +-/*# sourceMappingURL=claro.css.map */ +\ No newline at end of file ++/*# sourceMappingURL=claro.css.map */ diff --git a/packages/drupal/gutenberg_blocks/css/edit.css b/packages/drupal/gutenberg_blocks/css/edit.css index 7c90c5d90..bd7f026ff 100644 --- a/packages/drupal/gutenberg_blocks/css/edit.css +++ b/packages/drupal/gutenberg_blocks/css/edit.css @@ -101,16 +101,6 @@ text-decoration: none; } -/* This is set by the Gutenberg module */ -/* Provide a patch to remove !important */ -/* -@media screen and (min-width: 85.375rem) { - .interface-complementary-area.edit-post-sidebar { - width: 380px !important; - } -} -*/ - .gutenberg__editor .drupal-preview-sidebar { min-width: 350px; border-right: 1px solid #e0e0e0; diff --git a/packages/drupal/gutenberg_blocks/src/preview.ts b/packages/drupal/gutenberg_blocks/src/preview.ts index de03f74a1..1fdd5e874 100644 --- a/packages/drupal/gutenberg_blocks/src/preview.ts +++ b/packages/drupal/gutenberg_blocks/src/preview.ts @@ -4,7 +4,7 @@ attach: function (context) { $(once('gutenbergBlocksPreview', '.gutenberg-full-editor', context)).each( function () { - $('#edit-preview-link').on('click', function (e) { + $('#edit-preview-link').on('click', function (e: Event) { e.preventDefault(); const previewUrl = drupalSettings.preview.previewUrl;