Browse Source

changed approach for alignfull cover blocks

Maggie 3 years ago
parent
commit
79c2fe97fe
4 changed files with 14 additions and 25 deletions
  1. 6 10
      skatepark/assets/theme.css
  2. 1 1
      skatepark/child-theme.json
  3. 6 13
      skatepark/sass/blocks/_cover.scss
  4. 1 1
      skatepark/theme.json

+ 6 - 10
skatepark/assets/theme.css

@@ -139,18 +139,14 @@ p {
 	letter-spacing: 0.1em;
 }
 
-.wp-block-cover .wp-block-cover__inner-container {
-	width: auto;
-}
-
-.wp-block-cover.has-custom-content-position.is-position-top-left, .wp-block-cover.has-custom-content-position.is-position-top-center, .wp-block-cover.has-custom-content-position.is-position-top-right {
-	padding-top: 5.75%;
-	padding-bottom: 17.25%;
+.wp-block-cover.alignfull {
+	padding-left: 0;
+	padding-right: 0;
 }
 
-.wp-block-cover.has-custom-content-position.is-position-bottom-left, .wp-block-cover.has-custom-content-position.is-position-bottom-center, .wp-block-cover.has-custom-content-position.is-position-bottom-right {
-	padding-top: 17.25%;
-	padding-bottom: 5.75%;
+.wp-block-cover.alignfull .wp-block-cover__inner-container {
+	padding-left: calc( max( 0.5 * ( 100% - var(--wp--custom--layout--wide-size) ), var(--wp--custom--post-content--padding--left) ));
+	padding-right: calc( max( 0.5 * ( 100% - var(--wp--custom--layout--wide-size) ), var(--wp--custom--post-content--padding--left) ));
 }
 
 .wp-block-post-comments .reply a {

+ 1 - 1
skatepark/child-theme.json

@@ -272,7 +272,7 @@
 			},
 			"core/cover": {
 				"spacing": {
-					"padding": "11.5%"
+					"padding": "5.75%"
 				}
 			},
 			"core/post-date": {

+ 6 - 13
skatepark/sass/blocks/_cover.scss

@@ -1,17 +1,10 @@
 .wp-block-cover {
-	.wp-block-cover__inner-container {
-		width: auto;
-	}
-
-	&.has-custom-content-position {
-		&.is-position-top-left, &.is-position-top-center, &.is-position-top-right {
-			padding-top: 5.75%;
-			padding-bottom: 17.25%;
-		}
-
-		&.is-position-bottom-left, &.is-position-bottom-center, &.is-position-bottom-right {
-			padding-top: 17.25%;
-			padding-bottom: 5.75%;
+	&.alignfull {
+		padding-left: 0;
+		padding-right: 0;
+		.wp-block-cover__inner-container {
+			padding-left: calc( max( 0.5 * ( 100% - var(--wp--custom--layout--wide-size) ), var(--wp--custom--post-content--padding--left) ));
+			padding-right: calc( max( 0.5 * ( 100% - var(--wp--custom--layout--wide-size) ), var(--wp--custom--post-content--padding--left) ));
 		}
 	}
 }

+ 1 - 1
skatepark/theme.json

@@ -539,7 +539,7 @@
 			},
 			"core/cover": {
 				"spacing": {
-					"padding": "11.5%"
+					"padding": "5.75%"
 				}
 			},
 			"core/post-terms": {