-
Notifications
You must be signed in to change notification settings - Fork 2k
/
index.styl
274 lines (244 loc) · 6.08 KB
/
index.styl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
@import "../Pisces/_layout";
@import "../Pisces/_brand";
@import "../Pisces/_menu";
@import "../Pisces/_sub-menu";
@import "../Pisces/_sidebar";
// Import _posts if want to justify text-align on mobile.
//@import "../Pisces/_posts";
// =================================================
// Rewrite _layout.styl
// =================================================
// Sidebar padding used as main desktop content padding for sidebar padding and post blocks padding too.
// In main NexT config set `sidebar: offset: 12` option as main padding.
// In `source/css/_variables/Gemini.styl` there are variables for other resolutions:
// $content-tablet-paddin = 10px;
// $content-mobile-padding = 8px;
// P.S. If u want to change this paddings u may set this variables into `source/css/_variables/custom.styl`.
// So, it will 12px in Desktop, 10px in Tablets and 8px in Mobiles for all possible paddings.
// =================================================
// Read values from NexT config and set they as local variables to use as string variables (in any CSS section).
hexo-config('sidebar.offset') is a 'unit' ? (sboffset = unit(hexo-config('sidebar.offset'), px)) : (sboffset = 0)
use_seo = hexo-config('seo');
// Maximum content width.
// =================================================
$max-content-width = hexo-config('max_content_width')
if $max-content-width {
.header,
.container .main-inner,
.footer-inner {
max-width: unquote($max-content-width);
}
}
// =================================================
// Desktop layout styles.
// =================================================
// Post blocks.
.content-wrap {
padding: initial;
background: initial;
box-shadow: initial;
border-radius: initial;
}
// Post & Comments blocks.
.post-block {
padding: $content-desktop-padding;
background: white;
box-shadow: $box-shadow-inner;
border-radius: $border-radius-inner;
}
// When blocks are siblings (homepage).
#posts > article + article {
.post-block {
margin-top: sboffset;
// Rewrite shadows & borders because all blocks have offsets.
box-shadow: $box-shadow;
border-radius: $border-radius;
}
}
// Comments blocks.
.comments {
padding: $content-desktop-padding;
margin: initial;
margin-top: sboffset;
background: white;
box-shadow: $box-shadow;
border-radius: $border-radius;
}
// Top main padding from header to posts (default 40px).
.posts-expand {
padding-top: initial;
}
// Post navigation items.
.post-nav-divider {
width: 4%;
}
.post-nav-item {
width: 48%;
}
// Post delimiters.
.post-eof,
.post-spread {
hide();
}
// Pagination.
.pagination {
.prev, .next, .page-number {
margin-bottom: initial;
top: initial;
}
margin: sboffset 0 0;
border-top: initial;
background: white;
box-shadow: $box-shadow;
border-radius: $border-radius;
padding: 10px 0 10px;
}
// Footer alignment.
.main {
padding-bottom: initial;
}
.footer {
bottom: auto;
}
// Sub-menu(s).
.sub-menu {
border-bottom: initial !important;
box-shadow: $box-shadow-inner;
// Adapt submenu(s) with post-blocks.
&+ #content > #posts {
.post-block {
box-shadow: $box-shadow;
margin-top: sboffset;
+tablet() {
margin-top: $content-tablet-padding;
}
+mobile() {
margin-top: $content-mobile-padding;
}
}
}
}
// =================================================
// Headers.
// =================================================
// No need anymore?
.post-header {
h1, h2 {
margin: initial;
}
}
.posts-expand .post-title-link {
line-height: inherit;
}
.posts-expand .post-title {
font-size: 1.7em;
}
.post-body {
h1 {
font-size: 1.6em;
border-bottom: 1px solid $body-bg-color;
}
h2 {
font-size: 1.45em;
border-bottom: 1px solid $body-bg-color;
}
h3 {
font-size: 1.3em;
if use_seo {
border-bottom: 1px solid $body-bg-color;
} else {
border-bottom: 1px dotted $body-bg-color;
}
}
h4 {
font-size: 1.2em;
if use_seo {
border-bottom: 1px dotted $body-bg-color;
}
}
h5 {
font-size: 1.07em;
}
h6 {
font-size: 1.03em;
}
}
// =================================================
// > 768px & < 991px
// =================================================
+tablet() {
// Posts in blocks.
.content-wrap {
padding: $content-tablet-padding;
}
.posts-expand {
margin: initial;
// Components inside Posts.
.post-button {
margin-top: ($content-tablet-padding * 2);
}
}
.post-block {
// Inside posts blocks content padding (default 40px).
padding: ($content-tablet-padding * 2);
// Rewrite shadows & borders because all blocks have offsets.
box-shadow: $box-shadow;
border-radius: $border-radius;
}
// Only if blocks are siblings need bottom margin (homepage).
#posts > article + article {
.post-block {
margin-top: $content-tablet-padding;
}
}
.comments {
margin-top: $content-tablet-padding;
padding: $content-tablet-padding ($content-tablet-padding * 2);
//padding: initial;
//padding-top: $content-tablet-padding;
}
.pagination {
margin: $content-tablet-padding 0 0;
}
}
// =================================================
// < 767px
// =================================================
+mobile() {
// Posts in blocks.
.content-wrap {
padding: $content-mobile-padding;
}
.posts-expand {
margin: initial;
// Components inside Posts.
.post-button {
margin-top: sboffset;
//padding-bottom : 15px;
}
img {
padding: initial !important;
}
}
.post-block {
// Inside posts blocks content padding (default 40px).
padding: sboffset;
min-height: auto;
// Rewrite shadows & borders because all blocks have offsets.
box-shadow: $box-shadow;
border-radius: $border-radius;
}
// Only if blocks are siblings need bottom margin (homepage).
#posts > article + article {
.post-block {
margin-top: $content-mobile-padding;
}
}
.comments {
margin-top: $content-mobile-padding;
padding: 0 sboffset;
}
.pagination {
margin: $content-mobile-padding 0 0;
}
}