浏览代码

_dsgnsystm: Fix text-align for H2 in cover block

Allan Cole 6 年之前
父节点
当前提交
784cd0ca52
共有 2 个文件被更改,包括 28 次插入1 次删除
  1. 13 1
      _dsgnsystm/sass/blocks/cover/_editor.scss
  2. 15 0
      _dsgnsystm/style-editor.css

+ 13 - 1
_dsgnsystm/sass/blocks/cover/_editor.scss

@@ -20,6 +20,18 @@
 		letter-spacing: #{map-deep-get($config-heading, "font", "letter-spacing", "h2")};
 		line-height: #{map-deep-get($config-heading, "font", "line-height", "h2")};
 		padding: 0;
-		text-align: left;
+		text-align: inherit;
+
+		&.has-text-align-left {
+			text-align: left;
+		}
+
+		&.has-text-align-center {
+			text-align: center;
+		}
+
+		&.has-text-align-right {
+			text-align: right;
+		}
 	}
 }

+ 15 - 0
_dsgnsystm/style-editor.css

@@ -316,9 +316,24 @@ object {
 	letter-spacing: normal;
 	line-height: 1.125;
 	padding: 0;
+	text-align: inherit;
+}
+
+.wp-block-cover h2.has-text-align-left,
+.wp-block-cover-image h2.has-text-align-left {
 	text-align: left;
 }
 
+.wp-block-cover h2.has-text-align-center,
+.wp-block-cover-image h2.has-text-align-center {
+	text-align: center;
+}
+
+.wp-block-cover h2.has-text-align-right,
+.wp-block-cover-image h2.has-text-align-right {
+	text-align: right;
+}
+
 .wp-block-heading h1, h1, .h1,
 .wp-block-heading h2, h2, .h2,
 .wp-block-heading h3, h3, .h3,