From 0fcfd2219200e12d1863d3f4d18c9e13bc1bbf07 Mon Sep 17 00:00:00 2001 From: mmtr Date: Fri, 23 Oct 2020 14:16:18 +0200 Subject: [PATCH 1/2] Reader: Keep inline styles in post content --- client/state/reader/posts/normalization-rules.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/state/reader/posts/normalization-rules.js b/client/state/reader/posts/normalization-rules.js index 542570cc8a3b23..3158f9fbf3946e 100644 --- a/client/state/reader/posts/normalization-rules.js +++ b/client/state/reader/posts/normalization-rules.js @@ -16,7 +16,6 @@ import detectMedia from 'calypso/lib/post-normalizer/rule-content-detect-media'; import detectPolls from 'calypso/lib/post-normalizer/rule-content-detect-polls'; import detectSurveys from 'calypso/lib/post-normalizer/rule-content-detect-surveys'; import makeEmbedsSafe from 'calypso/lib/post-normalizer/rule-content-make-embeds-safe'; -import removeStyles from 'calypso/lib/post-normalizer/rule-content-remove-styles'; import makeImagesSafe from 'calypso/lib/post-normalizer/rule-content-make-images-safe'; import { disableAutoPlayOnMedia, @@ -106,7 +105,6 @@ const fastPostNormalizationRules = flow( [ safeImageProperties( READER_CONTENT_WIDTH ), makeLinksSafe, withContentDom( [ - removeStyles, removeElementsBySelector, makeImagesSafe(), makeEmbedsSafe, From 96a65d8c72cff8e86eb15e46d6c559e887609d03 Mon Sep 17 00:00:00 2001 From: mmtr Date: Fri, 23 Oct 2020 15:31:49 +0200 Subject: [PATCH 2/2] Remove button block styles --- client/blocks/reader-full-post/_content.scss | 44 +++++++------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/client/blocks/reader-full-post/_content.scss b/client/blocks/reader-full-post/_content.scss index 46787e25cec73b..0a06af9d41b4b0 100644 --- a/client/blocks/reader-full-post/_content.scss +++ b/client/blocks/reader-full-post/_content.scss @@ -10,7 +10,7 @@ margin: 0; padding-top: 16px; position: relative; - font-size: 17px; + font-size: 1rem; line-height: 1.7; overflow-wrap: break-word; word-wrap: break-word; @@ -196,7 +196,7 @@ position: relative; margin-bottom: 24px; padding: 11px 24px; - border-radius: 1px; + border-radius: 2px; background: var( --color-neutral-0 ); box-sizing: border-box; font-size: $font-body-small; @@ -213,7 +213,7 @@ sub { vertical-align: baseline; position: relative; - font-size: 0.83em; + font-size: 0.875rem; } sup { @@ -248,28 +248,17 @@ margin: auto; } - .wp-block-buttons { - margin: 0; - } - - .wp-block-button { - border-style: solid; + .wp-block-button__link { + // Styles forced with !important in order to override the inline styles present in the post content. + border: 1px solid var( --color-neutral-10 ) !important; + background-color: inherit !important; + color: inherit !important; + border-radius: 2px !important; + padding: 8px 14px !important; + font-size: 0.875rem !important; font-family: $sans; - border-width: 1px; - cursor: pointer; - display: inline-block; - margin: 0; - margin-right: 0.25em; - margin-bottom: 0.6em; - outline: 0; - overflow: hidden; - vertical-align: top; - font-size: 14px; font-weight: 600; line-height: 22px; - border-radius: 2px; - padding: 8px 14px; - border-color: var( --color-neutral-10 ); } .wp-block-table table { @@ -279,7 +268,7 @@ .wp-block-table td, .wp-block-table th { border: 1px solid var( --color-neutral-10 ); - font-size: 1em; + font-size: 1rem; line-height: 1.8; } @@ -288,11 +277,6 @@ background: var( --color-neutral-0 ); } - .wp-block-button__link, - .wp-block-button__link:hover { - color: inherit; - } - // Import Gutenberg gallery styles @import 'gutenberg-gallery.scss'; @@ -321,7 +305,7 @@ &:first-child::first-letter { float: left; margin: 10px 12px 0 0; - font-size: 66px; + font-size: 66px; /* stylelint-disable-line scales/font-size */ font-weight: 400; line-height: 0.7; } @@ -493,7 +477,7 @@ display: block; width: 36px; height: 36px; - border-radius: 36px; + border-radius: 36px; /* stylelint-disable-line scales/radii */ margin-right: 8px; transition: transform 0.1s ease; }