瀏覽代碼

Merge pull request #2696 from Automattic/fix/spearhead-sticky-padding

Adjust sticky post padding.
Ben Dwyer 4 年之前
父節點
當前提交
f36a7908a1
共有 4 個文件被更改,包括 29 次插入0 次删除
  1. 11 0
      spearhead/assets/sass/_posts-and-pages.scss
  2. 9 0
      spearhead/style-rtl.css
  3. 9 0
      spearhead/style.css
  4. 0 0
      spearhead/style.css.map

+ 11 - 0
spearhead/assets/sass/_posts-and-pages.scss

@@ -59,6 +59,7 @@
 
 .post.sticky { // .post class needed to make this stronger
 	background: var(--sticky-posts--color-background);
+	padding-bottom: calc(2 * var(--global--spacing-vertical));
 
 	.entry-title {
 		font-size: var(--sticky-posts--entry-title-font-size);
@@ -67,6 +68,16 @@
 	.entry-content {
 		font-size: var(--sticky-posts--entry-content-font-size);
 	}
+
+	// Subsequent sticky posts do not need extra top padding.
+	+ .post.sticky {
+		padding-top: 0;
+	}
+
+	// The first non-sticky post does need extra top padding.
+	+ article:not(.post.sticky) {
+		padding-top: calc(2 * var(--global--spacing-vertical));
+	}
 }
 
 .sticky-post {

+ 9 - 0
spearhead/style-rtl.css

@@ -93,6 +93,7 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
 
 .post.sticky {
 	background: var(--sticky-posts--color-background);
+	padding-bottom: calc(2 * var(--global--spacing-vertical));
 }
 
 .post.sticky .entry-title {
@@ -103,6 +104,14 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
 	font-size: var(--sticky-posts--entry-content-font-size);
 }
 
+.post.sticky + .post.sticky {
+	padding-top: 0;
+}
+
+.post.sticky + article:not(.post.sticky) {
+	padding-top: calc(2 * var(--global--spacing-vertical));
+}
+
 .sticky-post {
 	display: none;
 }

+ 9 - 0
spearhead/style.css

@@ -93,6 +93,7 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
 
 .post.sticky {
 	background: var(--sticky-posts--color-background);
+	padding-bottom: calc(2 * var(--global--spacing-vertical));
 }
 
 .post.sticky .entry-title {
@@ -103,6 +104,14 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me
 	font-size: var(--sticky-posts--entry-content-font-size);
 }
 
+.post.sticky + .post.sticky {
+	padding-top: 0;
+}
+
+.post.sticky + article:not(.post.sticky) {
+	padding-top: calc(2 * var(--global--spacing-vertical));
+}
+
 .sticky-post {
 	display: none;
 }

文件差異過大導致無法顯示
+ 0 - 0
spearhead/style.css.map


部分文件因文件數量過多而無法顯示