فهرست منبع

Blockbase: Update paragraph gap (#5104)

* Blockbase: Restrict these paragraph rules to post content

* Rename file to target the blocks

* Rebuild
Ben Dwyer 3 سال پیش
والد
کامیت
171411da07

+ 7 - 7
blockbase/assets/ponyfill.css

@@ -204,13 +204,6 @@ body.admin-bar .wp-site-blocks {
 	min-height: calc( 100vh - var(--wpadmin-bar--height));
 }
 
-p.wp-block.wp-block-paragraph,
-*[class^="wp-container"] > * + p,
-*[class^="wp-container"] > p + *,
-p {
-	margin-top: 1em;
-}
-
 .image-no-margin {
 	margin: 0;
 }
@@ -678,6 +671,13 @@ p.has-drop-cap:not(:focus):first-letter {
 	margin-bottom: var(--wp--custom--gap--baseline);
 }
 
+.wp-block-post-content p.wp-block.wp-block-paragraph,
+.wp-block-post-content *[class^="wp-container"] > * + p,
+.wp-block-post-content *[class^="wp-container"] > p + *,
+.wp-block-post-content p {
+	margin-top: 1em;
+}
+
 .wp-block-post-template {
 	margin-top: 0;
 	margin-bottom: 0;

+ 0 - 1
blockbase/sass/base/_style.scss

@@ -11,5 +11,4 @@
 @import "colors";
 @import "header";
 @import "layout";
-@import "text";
 @import "utility";

+ 0 - 7
blockbase/sass/base/_text.scss

@@ -1,7 +0,0 @@
-// Needed until https://github.com/WordPress/gutenberg/issues/35267 is resolved.
-p.wp-block.wp-block-paragraph, // This selector has been made extra specific to override the block gap being set in the editor.
-*[class^="wp-container"] > * + p,
-*[class^="wp-container"] > p + *,
-p {
-	margin-top: 1em;
-}

+ 9 - 0
blockbase/sass/blocks/_post-content.scss

@@ -0,0 +1,9 @@
+// Needed until https://github.com/WordPress/gutenberg/issues/35267 is resolved.
+.wp-block-post-content { // Only apply these margins in the post content.
+	p.wp-block.wp-block-paragraph, // This selector has been made extra specific to override the block gap being set in the editor.
+	*[class^="wp-container"] > * + p,
+	*[class^="wp-container"] > p + *,
+	p {
+		margin-top: 1em;
+	}
+}

+ 1 - 0
blockbase/sass/ponyfill.scss

@@ -18,6 +18,7 @@
 @import "blocks/paragraph";
 @import "blocks/post-author";
 @import "blocks/post-comments";
+@import "blocks/post-content";
 @import "blocks/post-template";
 @import "blocks/pullquote";
 @import "blocks/query-pagination";