index.styl 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. @import '../Pisces/_layout';
  2. @import '../Pisces/_header';
  3. @import '../Pisces/_menu';
  4. @import '../Pisces/_sub-menu';
  5. @import '../Pisces/_sidebar';
  6. // ==================================================
  7. // Rewrite _layout.styl
  8. // ==================================================
  9. // Sidebar padding used as main desktop content padding for sidebar padding and post blocks padding too.
  10. // In `source/css/_variables/Pisces.styl` there are variable for main offset:
  11. // $sidebar-offset = 12px;
  12. // This value alse can be changed in main NexT config as `sidebar: offset: 12` option.
  13. // In `source/css/_variables/base.styl` there are variables for other resolutions:
  14. // $content-tablet-padding = 10px;
  15. // $content-mobile-padding = 8px;
  16. // P.S. If u want to change this paddings u may set this variables into `custom_file_path.variable` (in theme _config.yml).
  17. // So, it will 12px in Desktop, 10px in Tablets and 8px in Mobiles for all possible paddings.
  18. // ==================================================
  19. // Read values from NexT config and set they as local variables to use as string variables (in any CSS section).
  20. $use-seo = hexo-config('seo');
  21. // ==================================================
  22. // Desktop layout styles.
  23. // ==================================================
  24. // Post blocks.
  25. .content-wrap {
  26. background: initial;
  27. box-shadow: initial;
  28. padding: initial;
  29. }
  30. // Post & Comments blocks.
  31. .post-block {
  32. background: var(--content-bg-color);
  33. border-radius: $border-radius-inner;
  34. box-shadow: $box-shadow-inner;
  35. padding: $content-desktop-padding;
  36. // When blocks are siblings (homepage).
  37. & + .post-block {
  38. border-radius: $border-radius;
  39. // Rewrite shadows & borders because all blocks have offsets.
  40. box-shadow: $box-shadow;
  41. margin-top: $sidebar-offset;
  42. }
  43. }
  44. // Comments blocks.
  45. .comments {
  46. background: var(--content-bg-color);
  47. border-radius: $border-radius;
  48. box-shadow: $box-shadow;
  49. margin-top: $sidebar-offset;
  50. padding: $content-desktop-padding;
  51. }
  52. .tabs-comment {
  53. margin-top: 1em;
  54. }
  55. // Top main padding from header to posts (default 40px).
  56. .content {
  57. padding-top: initial;
  58. }
  59. // Post delimiters.
  60. .post-eof {
  61. display: none;
  62. }
  63. // Pagination.
  64. .pagination {
  65. .prev, .next, .page-number {
  66. margin-bottom: initial;
  67. top: initial;
  68. }
  69. background: var(--content-bg-color);
  70. border-radius: $border-radius;
  71. border-top: initial;
  72. box-shadow: $box-shadow;
  73. margin: $sidebar-offset 0 0;
  74. padding: 10px 0 10px;
  75. }
  76. // Footer alignment.
  77. .main {
  78. padding-bottom: initial;
  79. }
  80. .footer {
  81. bottom: auto;
  82. }
  83. // Sub-menu(s).
  84. .sub-menu {
  85. border-bottom: initial;
  86. box-shadow: $box-shadow-inner;
  87. // Adapt submenu(s) with post-blocks.
  88. + .content .post-block {
  89. box-shadow: $box-shadow;
  90. margin-top: $sidebar-offset;
  91. +tablet() {
  92. margin-top: $content-tablet-padding;
  93. }
  94. +mobile() {
  95. margin-top: $content-mobile-padding;
  96. }
  97. }
  98. }
  99. // ==================================================
  100. // Headers.
  101. // ==================================================
  102. .post-body {
  103. h1, h2 {
  104. border-bottom: 1px solid $body-bg-color;
  105. }
  106. h3 {
  107. if ($use-seo) {
  108. border-bottom: 1px solid $body-bg-color;
  109. } else {
  110. border-bottom: 1px dotted $body-bg-color;
  111. }
  112. }
  113. h4 {
  114. if ($use-seo) {
  115. border-bottom: 1px dotted $body-bg-color;
  116. }
  117. }
  118. }
  119. // ==================================================
  120. // > 768px & < 991px
  121. // ==================================================
  122. +tablet() {
  123. // Posts in blocks.
  124. .content-wrap {
  125. padding: $content-tablet-padding;
  126. }
  127. .posts-expand {
  128. // Components inside Posts.
  129. .post-button {
  130. margin-top: ($content-tablet-padding * 2);
  131. }
  132. }
  133. .post-block {
  134. border-radius: $border-radius;
  135. // Rewrite shadows & borders because all blocks have offsets.
  136. box-shadow: $box-shadow;
  137. // Inside posts blocks content padding (default 40px).
  138. padding: ($content-tablet-padding * 2);
  139. }
  140. // Only if blocks are siblings need bottom margin (homepage).
  141. .post-block + .post-block {
  142. margin-top: $content-tablet-padding;
  143. }
  144. .comments {
  145. margin-top: $content-tablet-padding;
  146. padding: $content-tablet-padding ($content-tablet-padding * 2);
  147. // padding: initial;
  148. // padding-top: $content-tablet-padding;
  149. }
  150. .pagination {
  151. margin: $content-tablet-padding 0 0;
  152. }
  153. }
  154. // ==================================================
  155. // < 767px
  156. // ==================================================
  157. +mobile() {
  158. // Posts in blocks.
  159. .content-wrap {
  160. padding: $content-mobile-padding;
  161. }
  162. .posts-expand {
  163. // Components inside Posts.
  164. .post-button {
  165. margin: $sidebar-offset 0;
  166. }
  167. }
  168. .post-block {
  169. border-radius: $border-radius;
  170. // Rewrite shadows & borders because all blocks have offsets.
  171. box-shadow: $box-shadow;
  172. min-height: auto;
  173. // Inside posts blocks content padding (default 40px).
  174. padding: $sidebar-offset;
  175. }
  176. // Only if blocks are siblings need bottom margin (homepage).
  177. .post-block + .post-block {
  178. margin-top: $content-mobile-padding;
  179. }
  180. .comments {
  181. margin-top: $content-mobile-padding;
  182. padding: 10px $sidebar-offset;
  183. }
  184. .pagination {
  185. margin: $content-mobile-padding 0 0;
  186. }
  187. }