Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader: Keep inline styles in post content #46720

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 14 additions & 30 deletions client/blocks/reader-full-post/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -213,7 +213,7 @@
sub {
vertical-align: baseline;
position: relative;
font-size: 0.83em;
font-size: 0.875rem;
}

sup {
Expand Down Expand Up @@ -248,28 +248,17 @@
margin: auto;
}

.wp-block-buttons {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why were these classes removed? (They aren't the correct styles, admittedly, but I feel like we still need them, without knowing a better place to put them)

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 {
Expand All @@ -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;
}

Expand All @@ -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';

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 0 additions & 2 deletions client/state/reader/posts/normalization-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -106,7 +105,6 @@ const fastPostNormalizationRules = flow( [
safeImageProperties( READER_CONTENT_WIDTH ),
makeLinksSafe,
withContentDom( [
removeStyles,
removeElementsBySelector,
makeImagesSafe(),
makeEmbedsSafe,
Expand Down