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

Styles: Convert px values to rem #22505

Closed
wants to merge 6 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
4 changes: 2 additions & 2 deletions packages/block-library/src/button/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$blocks-button__height: 56px;
$blocks-button__height: 3.5rem;

// Prefer the link selector instead of the regular button classname
// to support the previous markup in addition to the new one.
Expand All @@ -11,7 +11,7 @@ $blocks-button__height: 56px;
cursor: pointer;
display: inline-block;
font-size: $big-font-size;
padding: 12px 24px;
padding: 0.75rem 1.5rem;
text-align: center;
text-decoration: none;
overflow-wrap: break-word;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/calendar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

th,
tbody td {
padding: 4px;
padding: 0.25rem;
border: 1px solid $light-gray-500;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/code/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
color: $dark-gray-800;
padding: 0.8em 1em;
border: 1px solid $light-gray-500;
border-radius: 4px;
border-radius: 0.25rem;
}
4 changes: 2 additions & 2 deletions packages/block-library/src/cover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
position: relative;
background-size: cover;
background-position: center center;
min-height: 430px;
min-height: 26.875rem;
height: 100%;
width: 100%;
display: flex;
Expand Down Expand Up @@ -92,7 +92,7 @@
}

.wp-block-cover__inner-container {
width: calc(100% - 70px);
width: calc(100% - 4.375rem);
z-index: z-index(".wp-block-cover__inner-container");
color: $light-gray-100;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$gallery-image-container-height: 150px;
$gallery-image-container-height: 9.375rem;
$overlay-border-width: 3px;
$caption-background-color: rgba(0, 0, 0, 0.4);
$caption-padding-vertical: 8px;
$caption-padding-vertical: 0.5rem;

.galleryImageContainer {
flex: 1;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/gallery/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
width: 100%;
max-height: 100%;
overflow: auto;
padding: 40px 10px 9px;
padding: 2.5rem 0.625rem 0.56rem;
color: $white;
text-align: center;
font-size: $default-font-size;
Expand Down
10 changes: 5 additions & 5 deletions packages/block-library/src/group/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
&.has-background > .wp-block-group__inner-container > [data-align="full"] {
// note: using position `left` causes hoz scrollbars so
// we opt to use margin instead
// the 30px matches the hoz padding applied in `theme.scss`
// the 1.875rem matches the hoz padding applied in `theme.scss`
// added when the Block has a background set
margin-left: -30px;
margin-left: -1.875rem;

// 60px here is x2 the hoz padding from `theme.scss` added when
// 3.75rem here is x2 the hoz padding from `theme.scss` added when
// the Block has a background set
// note: also duplicated below for full width Groups
width: calc(100% + 60px);
width: calc(100% + 3.75rem);
}
}

Expand All @@ -61,7 +61,7 @@
// Full Width Blocks with a background (ie: has padding)
// note: also duplicated above for all Group widths
&.has-background > .wp-block-group__inner-container > [data-align="full"] {
width: calc(100% + 60px);
width: calc(100% + 3.75rem);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/group/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
&.has-background {
// Matches paragraph Block padding
// Todo: normalise with variables
padding: 20px 30px;
padding: 1.25rem 1.875rem;
margin-top: 0;
margin-bottom: 0;
}
Expand Down
8 changes: 4 additions & 4 deletions packages/block-library/src/latest-comments/editor.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.wp-block-latest-comments.has-avatars .avatar {
margin-right: 10px;
margin-right: 0.625rem;
}

.wp-block-latest-comments__comment-excerpt p {
font-size: 14px;
font-size: 0.875rem;
line-height: $editor-line-height;
margin: 5px 0 20px;
margin: 0.3125rem 0 1.25rem;
padding-top: 0;
}

.wp-block-latest-comments.has-avatars .wp-block-latest-comments__comment {
min-height: 36px;
min-height: 2.25rem;
}
20 changes: 10 additions & 10 deletions packages/block-library/src/latest-comments/style.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.wp-block-latest-comments__comment {
font-size: 15px;
font-size: 1rem;
line-height: 1.1;
list-style: none;
margin-bottom: 1em;

.has-avatars & {
min-height: 36px;
min-height: 2.25rem;
list-style: none;

.wp-block-latest-comments__comment-meta,
.wp-block-latest-comments__comment-excerpt {
margin-left: 52px;
margin-left: 3.25rem;
}
}

Expand All @@ -21,23 +21,23 @@
}

.wp-block-latest-comments__comment-excerpt p {
font-size: 14px;
font-size: 0.875rem;
line-height: 1.8;
margin: 5px 0 20px;
margin: 0.3125rem 0 1.25rem;
}

.wp-block-latest-comments__comment-date {
color: $dark-gray-100;
display: block;
font-size: 12px;
font-size: 0.75rem;
}

.wp-block-latest-comments .avatar,
.wp-block-latest-comments__comment-avatar {
border-radius: 24px;
border-radius: 1.5rem;
display: block;
float: left;
height: 40px;
margin-right: 12px;
width: 40px;
height: 2.5rem;
margin-right: 0.75rem;
width: 2.5rem;
}
6 changes: 3 additions & 3 deletions packages/block-library/src/latest-posts/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
padding: 0;

li {
margin: 0 20px 20px 0;
margin: 0 1.25rem 1.25rem 0;
width: 100%;
}
}

@include break-small {
@for $i from 2 through 6 {
&.columns-#{ $i } li {
width: calc((100% / #{ $i }) - 20px);
width: calc((100% / #{ $i }) - 1.25rem);
}
}
}
Expand Down Expand Up @@ -65,5 +65,5 @@
}

.edit-post-visual-editor .wp-block-latest-posts.is-grid li {
margin-bottom: 20px;
margin-bottom: 1.25rem;
}
2 changes: 1 addition & 1 deletion packages/block-library/src/media-text/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

.wp-block-media-text.is-image-fill figure.wp-block-media-text__media {
height: 100%;
min-height: 250px;
min-height: 15.625rem;
background-size: cover;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$navigation-height: 60px;
$navigation-item-height: 46px;
$navigation-height: 3.75rem;
$navigation-item-height: 2.875rem;

// Undo default editor styles.
.editor-styles-wrapper .wp-block-navigation ul,
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
visibility: hidden;

> .wp-block-navigation-link {
font-size: 15px;
font-size: 0.9375rem;

> .wp-block-navigation-link__content {
flex-grow: 1;
Expand Down Expand Up @@ -116,7 +116,7 @@
}

.wp-block-navigation-link__label {
font-size: 17px;
font-size: 1.0625rem;
font-family: $default-font;

word-break: normal;
Expand Down
8 changes: 4 additions & 4 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 Down
6 changes: 3 additions & 3 deletions packages/block-library/src/pullquote/editor.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.wp-block[data-align="left"] > .wp-block-pullquote,
.wp-block[data-align="right"] > .wp-block-pullquote {
& p {
font-size: 20px;
font-size: 1.25rem;
}
}

.wp-block-pullquote {
& blockquote p {
font-size: 28px;
font-size: 1.75rem;
line-height: 1.6;
}
}
Expand All @@ -17,7 +17,7 @@
margin-right: 0;

& blockquote p {
font-size: 32px;
font-size: 2rem;
}

.wp-block-pullquote__citation {
Expand Down
6 changes: 3 additions & 3 deletions packages/block-library/src/pullquote/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
max-width: $content-width / 2;

p {
font-size: 20px;
font-size: 1.25rem;
}
}

p {
font-size: 28px;
font-size: 1.75rem;
line-height: 1.6;
}

Expand Down Expand Up @@ -43,7 +43,7 @@
p {
margin-top: 0;
margin-bottom: 0;
font-size: 32px;
font-size: 2rem;
}

cite {
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/pullquote/theme.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.wp-block-pullquote {
border-top: 4px solid $dark-gray-500;
border-bottom: 4px solid $dark-gray-500;
border-top: 0.25rem solid $dark-gray-500;
border-bottom: 0.25rem solid $dark-gray-500;
margin-bottom: $default-block-margin;
color: $dark-gray-600;

Expand Down
6 changes: 3 additions & 3 deletions packages/block-library/src/quote/style.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.wp-block-quote {
&.is-style-large,
&.is-large {
margin: 0 0 16px;
margin: 0 0 1rem;
padding: 0 1em;

p {
font-size: 24px;
font-size: 1.5rem;
font-style: italic;
line-height: 1.6;
}

cite,
footer {
font-size: 18px;
font-size: 1.125rem;
text-align: right;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/quote/theme.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.wp-block-quote {
border-left: 4px solid $black;
border-left: 0.25rem solid $black;
margin: 0 0 $default-block-margin 0;
padding-left: 1em;

Expand All @@ -16,7 +16,7 @@
&.has-text-align-right,
&.has-text-align-right {
border-left: none;
border-right: 4px solid $black;
border-right: 0.25rem solid $black;
padding-left: 0;
padding-right: 1em;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/rss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
list-style: none;

li {
margin: 0 16px 16px 0;
margin: 0 1rem 1rem 0;
width: 100%;
}
}

@include break-small {
@for $i from 2 through 6 {
&.columns-#{ $i } li {
width: calc(( 100% / #{ $i } ) - 16px);
width: calc(( 100% / #{ $i } ) - 1rem);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/search/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

.wp-block-search__input {
flex-grow: 1;
max-width: 360px;
max-width: 22.5em;
}

.wp-block-search__button {
margin-left: 10px;
margin-left: 0.625em;
}
}
2 changes: 1 addition & 1 deletion packages/block-library/src/separator/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
&::before {
content: "\00b7 \00b7 \00b7";
color: currentColor;
font-size: 20px;
font-size: 1.25rem;
letter-spacing: 2em;
/*rtl:ignore*/
padding-left: 2em;
Expand Down
Loading