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

Paragraph block: Use relative instead of absolute units #24330

Closed
wants to merge 1 commit into from
Closed
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
Paragraph block: Use relative instead of absolute units
  • Loading branch information
aristath committed Aug 3, 2020
commit 47efef0d05ce01dec0d547dbd245c6ccd18a16e5
10 changes: 5 additions & 5 deletions packages/block-library/src/paragraph/style.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
.is-small-text {
font-size: 14px;
font-size: 0.875rem;
}

.is-regular-text {
font-size: 16px;
font-size: 1rem;
}

.is-large-text {
font-size: 36px;
font-size: 2.25rem;
}

.is-larger-text {
font-size: 48px;
font-size: 3rem;
}

// Don't show the drop cap when editing the paragraph's content. It causes a
Expand All @@ -29,7 +29,7 @@
}

p.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
padding: 1.25em 2.375em;
}
Comment on lines 31 to 33
Copy link
Member

Choose a reason for hiding this comment

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

This is the only change I'm not sure of. If we want to change this, shoudn't we change it at the variable itself? Should we even change it in the first place?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this part was also troubling me a bit... so I pushed it as a point for discussion.
If users add a small-text, should it have smaller padding than a large-text? If yes, then em values make sense. If on the other hand we want consistent paddings that don't depend on the font-size, then em doesn't make sense and could be changed to rem values.
The reason I didn't change the variables themselves is because they are used in other blocks as well (columns & heading) and the change would affect more styles than intended. 🤔

If the padding change is a blocker for this PR I can just remove it and bring it up in a meeting for further discussion.


p.has-text-color a {
Expand Down