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

Update the .is-dark-theme UI for Quote and Pullquote blocks #26510

Merged
merged 1 commit into from
Oct 27, 2020
Merged
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
10 changes: 10 additions & 0 deletions packages/block-library/src/pullquote/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
margin-bottom: 1.75em;
color: #555;

.is-dark-theme & {
border-top: 4px solid $light-gray-placeholder;
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this an internal UI variable? Shouldn't we be avoiding the use of those on front-end block styles?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. This is where the styles were defined for the editor, so adding this to account for the styles against a dark background worked here. I believe that themes need to opt-in for this though, right? Reading from: #16732

If a theme opts in, these are provided in the front-end as well, via the theme.css stylesheet.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, themes need to opt-in to use this. I'm just not sure if this is the right approach. I mean, we're not using an SCSS variable for the non-dark-theme color, so why are we using one here? Or perhaps we should be using variables for both? It just seems inconsistent right now.

border-bottom: 4px solid $light-gray-placeholder;
color: $light-gray-placeholder;
}

cite,
footer,
&__citation {
color: #555;
text-transform: uppercase;
font-size: 0.8125em;
font-style: normal;

.is-dark-theme & {
color: $light-gray-placeholder;
}
}
}
8 changes: 8 additions & 0 deletions packages/block-library/src/quote/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
margin: 0 0 1.75em 0;
padding-left: 1em;

.is-dark-theme & {
border-left: 0.25em solid $light-gray-placeholder;
}

cite,
footer,
&__citation {
Expand All @@ -11,6 +15,10 @@
margin-top: 1em;
position: relative;
font-style: normal;

.is-dark-theme & {
color: $light-gray-placeholder;
}
}

&.has-text-align-right {
Expand Down