From 4485490b0ba11dba4982bf0d83e3a614067ead3b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Wed, 26 Jul 2023 15:03:45 +0200 Subject: [PATCH 1/2] Customize rendering inside the trix-editor, to match the shopfront rendering --- app/webpacker/css/admin/trix.scss | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/webpacker/css/admin/trix.scss b/app/webpacker/css/admin/trix.scss index 77eb6e1379..b07977c234 100644 --- a/app/webpacker/css/admin/trix.scss +++ b/app/webpacker/css/admin/trix.scss @@ -2,9 +2,25 @@ trix-toolbar [data-trix-button-group="file-tools"] { display: none; } +// Match the rendering into the shopfront trix-editor { + color: $darker-grey; + ol, ul { margin-left: 1.5em; } + + a { + color: $ofn-brand; + } + + // Copy/pasted from _type.scss + blockquote { + line-height: 1.6; + color: #6f6f6f; + margin: 0 0 1.25rem; + padding: 0.5625rem 1.25rem 0 1.1875rem; + border-left: 1px solid #dddddd; + } } From a179c006fc1114da2f2c6d81f2959ae19c106033 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 27 Jul 2023 11:41:45 +0200 Subject: [PATCH 2/2] Default design for `ul` and `ol` into the custom tab `ul` and `old` default design already been reset, reactivate default design only for `.custom-tab` --- app/views/shopping_shared/tabs/_custom.html.haml | 2 +- app/webpacker/css/darkswarm/shop_tabs.scss | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/views/shopping_shared/tabs/_custom.html.haml b/app/views/shopping_shared/tabs/_custom.html.haml index 4ef58be338..34bed5f243 100644 --- a/app/views/shopping_shared/tabs/_custom.html.haml +++ b/app/views/shopping_shared/tabs/_custom.html.haml @@ -1,4 +1,4 @@ .content .row - .columns + .columns.custom-tab = sanitize(@distributor.custom_tab&.content, scrubber: TrixScrubber.new) diff --git a/app/webpacker/css/darkswarm/shop_tabs.scss b/app/webpacker/css/darkswarm/shop_tabs.scss index f7355f5606..490231366e 100644 --- a/app/webpacker/css/darkswarm/shop_tabs.scss +++ b/app/webpacker/css/darkswarm/shop_tabs.scss @@ -119,6 +119,20 @@ margin-top: 0.75rem; margin-bottom: 2px; } + + .custom-tab { + ol, ul { + margin-left: 1.5em; + } + + ol { + list-style-type: decimal; + } + + ul { + list-style-type: disc; + } + } } &.with-darker-background {