소스 검색

Merge pull request #2992 from Automattic/blank-canvas/improve-top-margin-css-rules

Blank Canvas: Improve top margin CSS rules
Ben Dwyer 4 년 전
부모
커밋
8c1e871e51
1개의 변경된 파일12개의 추가작업 그리고 14개의 파일을 삭제
  1. 12 14
      blank-canvas/style.css

+ 12 - 14
blank-canvas/style.css

@@ -30,14 +30,6 @@ GNU General Public License for more details.
 
 @import "variables.css";
 
-/* Remove outside padding on single post pages. */
-
-.single .site-main,
-.page .site-main {
-	padding-top: 0;
-	padding-bottom: 0;
-}
-
 /* Remove extra margin from articles on single post pages. */
 
 .single .site-main > article,
@@ -45,11 +37,17 @@ GNU General Public License for more details.
 	margin-bottom: 0;
 }
 
-/* Add some top padding if the first block on the page is not full-width or a spacer. */
-
-.single .entry-content > *:first-child:not(.alignfull):not(.wp-block-spacer),
-.page .entry-content > *:first-child:not(.alignfull):not(.wp-block-spacer) {
-	padding-top: var(--global--spacing-vertical);
+/* Add some top padding if the first block on the page is a full-width image, cover, media & text, or group block. */
+
+.single .entry-content > .wp-block-image.alignfull:first-child,
+.page .entry-content > .wp-block-image.alignfull:first-child,
+.single .entry-content > .wp-block-cover.alignfull:first-child,
+.page .entry-content > .wp-block-cover.alignfull:first-child,
+.single .entry-content > .wp-block-media-text.alignfull:first-child,
+.page .entry-content > .wp-block-media-text.alignfull:first-child
+.single .entry-content > .wp-block-group.has-background.alignfull:first-child,
+.page .entry-content > .wp-block-group.has-background.alignfull:first-child {
+	margin-top: calc(-1 * var(--global--spacing-vertical));
 }
 
 /* Add some top padding for archive pages. */
@@ -80,4 +78,4 @@ body:not(.single):not(.page) .site-content {
 .entry-footer,
 .site-info {
 	text-align: center;
-}
+}