浏览代码

Merge pull request #1198 from Automattic/fix/1127-calm-business-fix-cover-heading-alignment

Calm Business: Fix the cover h2 alignment
Daniel Dudzic 5 年之前
父节点
当前提交
a09bb9535c

+ 18 - 0
calm-business/sass/blocks/_blocks.scss

@@ -573,6 +573,24 @@
 			text-align: inherit;
 		}
 
+		h2 {
+			padding: 0;
+			max-width: inherit; // undo opinionated styles
+			text-align: inherit;
+
+			&.has-text-align-left {
+				text-align: left;
+			}
+
+			&.has-text-align-center {
+				text-align: center;
+			}
+
+			&.has-text-align-right {
+				text-align: right;
+			}
+		}
+
 		h3 {
 			font-size: $font__size-md;
 		}

+ 16 - 0
calm-business/style-editor.css

@@ -1140,9 +1140,21 @@ figcaption,
   font-size: 1.6875em;
   max-width: 100%;
   padding: 0;
+  text-align: inherit;
+}
+
+.wp-block-cover .wp-block-cover__inner-container h2.has-text-align-left {
   text-align: left;
 }
 
+.wp-block-cover .wp-block-cover__inner-container h2.has-text-align-center {
+  text-align: center;
+}
+
+.wp-block-cover .wp-block-cover__inner-container h2.has-text-align-right {
+  text-align: right;
+}
+
 .wp-block-cover .wp-block-cover__inner-container h3 {
   font-size: 1.125em;
 }
@@ -1185,6 +1197,10 @@ figcaption,
   }
 }
 
+.wp-block-cover h2 {
+  text-align: inherit;
+}
+
 @media only screen and (min-width: 768px) {
   .wp-block-cover {
     padding: 1rem 10%;

+ 17 - 1
calm-business/style-editor.scss

@@ -319,7 +319,19 @@ figcaption,
 			font-size: $font__size-lg;
 			max-width: 100%;
 			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;
+			}
 		}
 
 		h3 {
@@ -369,6 +381,10 @@ figcaption,
 		}
 	}
 
+	h2 {
+		text-align: inherit;
+	}
+
 	@include media(tablet) {
 		padding: $size__spacing-unit 10%;
 		min-height: 620px;

+ 22 - 0
calm-business/style-rtl.css

@@ -4125,6 +4125,28 @@ body.page .main-navigation {
   text-align: inherit;
 }
 
+.entry .entry-content .wp-block-cover-image h2,
+.entry .entry-content .wp-block-cover h2 {
+  padding: 0;
+  max-width: inherit;
+  text-align: inherit;
+}
+
+.entry .entry-content .wp-block-cover-image h2.has-text-align-left,
+.entry .entry-content .wp-block-cover h2.has-text-align-left {
+  text-align: right;
+}
+
+.entry .entry-content .wp-block-cover-image h2.has-text-align-center,
+.entry .entry-content .wp-block-cover h2.has-text-align-center {
+  text-align: center;
+}
+
+.entry .entry-content .wp-block-cover-image h2.has-text-align-right,
+.entry .entry-content .wp-block-cover h2.has-text-align-right {
+  text-align: left;
+}
+
 .entry .entry-content .wp-block-cover-image h3,
 .entry .entry-content .wp-block-cover h3 {
   font-size: 1.125em;

+ 22 - 0
calm-business/style.css

@@ -4137,6 +4137,28 @@ body.page .main-navigation {
   text-align: inherit;
 }
 
+.entry .entry-content .wp-block-cover-image h2,
+.entry .entry-content .wp-block-cover h2 {
+  padding: 0;
+  max-width: inherit;
+  text-align: inherit;
+}
+
+.entry .entry-content .wp-block-cover-image h2.has-text-align-left,
+.entry .entry-content .wp-block-cover h2.has-text-align-left {
+  text-align: left;
+}
+
+.entry .entry-content .wp-block-cover-image h2.has-text-align-center,
+.entry .entry-content .wp-block-cover h2.has-text-align-center {
+  text-align: center;
+}
+
+.entry .entry-content .wp-block-cover-image h2.has-text-align-right,
+.entry .entry-content .wp-block-cover h2.has-text-align-right {
+  text-align: right;
+}
+
 .entry .entry-content .wp-block-cover-image h3,
 .entry .entry-content .wp-block-cover h3 {
   font-size: 1.125em;