Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

Varia: Center image block by default. #1463

Merged
merged 3 commits into from
Oct 2, 2019
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
1 change: 1 addition & 0 deletions varia/sass/blocks/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@import "code/editor";
@import "cover/editor";
@import "heading/editor";
@import "image/editor";
@import "gallery/editor";
@import "group/editor";
@import "latest-comments/editor";
Expand Down
9 changes: 9 additions & 0 deletions varia/sass/blocks/image/_editor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* Center image block by default in the editor */

.wp-block-image > div {
text-align: center;
}

[data-type="core/image"] .block-editor-block-list__block-edit figure.is-resized {
margin:0 auto;
}
1 change: 1 addition & 0 deletions varia/sass/blocks/image/_style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.wp-block-image {
text-align: center;

figcaption {
color: #{map-deep-get($config-global, "color", "foreground", "light")};
Expand Down
9 changes: 9 additions & 0 deletions varia/style-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@ object {
line-height: 1.125;
}

/* Center image block by default in the editor */
.wp-block-image > div {
text-align: center;
}

[data-type="core/image"] .block-editor-block-list__block-edit figure.is-resized {
margin: 0 auto;
}

.wp-block-gallery figcaption {
margin-bottom: 0;
}
Expand Down
4 changes: 4 additions & 0 deletions varia/style-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,10 @@ h6, .h6 {
line-height: 1.125;
}

.wp-block-image {
text-align: center;
}

.wp-block-image figcaption {
color: #767676;
font-size: 0.69444rem;
Expand Down
4 changes: 4 additions & 0 deletions varia/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,10 @@ h6, .h6 {
line-height: 1.125;
}

.wp-block-image {
text-align: center;
}

.wp-block-image figcaption {
color: #767676;
font-size: 0.69444rem;
Expand Down