瀏覽代碼

Merge pull request #1463 from Automattic/fix/issue-1407

Varia: Center image block by default.
Takashi Irie 5 年之前
父節點
當前提交
7eedb1c67b

+ 1 - 0
varia/sass/blocks/_editor.scss

@@ -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";

+ 9 - 0
varia/sass/blocks/image/_editor.scss

@@ -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 - 0
varia/sass/blocks/image/_style.scss

@@ -1,4 +1,5 @@
 .wp-block-image {
+	text-align: center;
 
 	figcaption {
 		color: #{map-deep-get($config-global, "color", "foreground", "light")};

+ 9 - 0
varia/style-editor.css

@@ -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;
 }

+ 4 - 0
varia/style-rtl.css

@@ -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;

+ 4 - 0
varia/style.css

@@ -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;