From 7d9018c590545af8865a2f6011410bec13a77097 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Mon, 12 Jun 2023 16:50:52 +0200 Subject: [PATCH 1/2] Instead of overriding css rules, prefer to not select rules for trix buttons --- app/webpacker/css/admin/components/buttons.scss | 4 ++-- app/webpacker/css/admin/trix.scss | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/app/webpacker/css/admin/components/buttons.scss b/app/webpacker/css/admin/components/buttons.scss index 5de746ea48..c96b70b17e 100644 --- a/app/webpacker/css/admin/components/buttons.scss +++ b/app/webpacker/css/admin/components/buttons.scss @@ -1,6 +1,6 @@ input[type="submit"], -input[type="button"], -button:not(.plain), +input[type="button"]:not(.trix-button), +button:not(.plain):not(.trix-button), .button { position: relative; cursor: pointer; diff --git a/app/webpacker/css/admin/trix.scss b/app/webpacker/css/admin/trix.scss index 01e72c1fd0..77eb6e1379 100644 --- a/app/webpacker/css/admin/trix.scss +++ b/app/webpacker/css/admin/trix.scss @@ -8,15 +8,3 @@ trix-editor { margin-left: 1.5em; } } - -trix-toolbar .trix-button { - background-color: transparent; - - &:hover { - background-color: transparent; - } - - &:disabled { - cursor: default; - } -} From d2534d6645667b20d8cc7f5be39926cfae38fb2c Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Wed, 21 Jun 2023 14:59:48 +0200 Subject: [PATCH 2/2] Be more specific via `!important` than the default button rule This one should override the default one --- app/webpacker/css/admin/openfoodnetwork.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/webpacker/css/admin/openfoodnetwork.scss b/app/webpacker/css/admin/openfoodnetwork.scss index 176cc00c26..e396dd1802 100644 --- a/app/webpacker/css/admin/openfoodnetwork.scss +++ b/app/webpacker/css/admin/openfoodnetwork.scss @@ -254,7 +254,8 @@ text-angular { display: inline; margin-right: 8px; button { - padding: 5px 10px; + padding: 5px 10px !important; // Add `!important` to be more specific than the default button styles (app/webpacker/css/admin/components/buttons.scss) + // Hope this (text-angular) will be removed soon in order to use trix editor margin-right: 0.25em; } button.active:not(:hover) {