-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path_intro.scss
243 lines (192 loc) · 4.33 KB
/
_intro.scss
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
// 首页主体内容
// NOTE: 为了让小模块标题居中 *并且* 带上适当宽度的 border-bottom,
// 只好在容器元素上玩一点花样了...
.mod-title {
> .section__content {
text-align: center;
}
}
// 小模块标题
.intro__title {
display: inline-block;
// 两边给一些富余的内边距用来撑开 border-bottom
padding: 0 1.5em 0.1em;
border-bottom: 1px solid rgba(#000, $alpha-divider);
font-size: 150%;
font-weight: 500;
// 标题居中
text-align: center; // 其实是多余的, 写在这里纯粹为了 readability
}
// 已经失效的小模块标题
.intro__title--disabled {
color: rgba(#000, $alpha-hint);
text-decoration: line-through;
}
// 小模块内容
.intro__content {
padding: 1em 0 2em;
// 让内容部分恢复正常对齐
text-align: justify;
// 在移动体验下也在两侧留白
@include media($mobile) {
padding-left: 1em;
padding-right: 1em;
}
}
// 允许例外: 让内容 (提示信息) 也居中
@mixin centered-intro-content {
> .intro__content {
text-align: center;
}
}
// 提示文字
.intro__text--note {
font-weight: 400;
border-bottom: 1px dashed rgba(0, 0, 0, $alpha-hint);
}
.intro__text--note-disabled {
color: rgba(#000, $alpha-hint);
}
// 小模块布局
.mod-intro__text {
@include media($wide) {
@include span-columns(12);
}
@include media($narrow) {
// 不要显得太挤
@include span-columns(4);
@include shift(1);
}
@include media($mobile) {
@include span-columns(4);
}
}
.mod-intro__tickets,
.mod-intro__apply,
.mod-intro__topics,
.mod-intro__contact {
@include media($wide) {
@include span-columns(6);
}
@include media($narrow) {
@include span-columns(3);
}
@include media($mobile) {
@include span-columns(4);
}
}
.mod-intro__apply,
.mod-intro__contact {
@include media($wide) {
@include omega;
}
@include media($narrow) {
@include omega;
}
}
// narrow: 只在左右两侧留白, 中间不要留, 所以 mobile 的 padding 策略不能直接应用
@include media($narrow) {
.mod-intro__tickets,
.mod-intro__topics {
> .intro__content {
padding-left: 1em;
}
}
// 这样虽然会破坏报名入口链接的完美对齐, 不过总比一边有一边没有的 padding
// 来得合适... Practicality beats purity, eh?
.mod-intro__apply,
.mod-intro__contact {
> .intro__content {
padding-right: 1em;
}
}
}
// 说明文字
.mod-intro__text {
font-size: 125%;
}
// 主题提交
.mod-intro__topics {
@include centered-intro-content;
}
// 门票策略
.mod-intro__tickets {
// TODO: 我有罪, 不该写裸元素选择器... 谁来重构一把? 现在夜里 3 点不太有心情
// 去改 HTML...
> .intro__content > dl {
> dt,
> dd {
margin-bottom: 1em;
}
> dt {
@include media($wide) {
@include span-columns(1 of 6);
}
@include media($narrow) {
@include span-columns(1 of 3);
}
@include media($mobile) {
@include span-columns(1 of 4);
}
}
> dd {
@include media($wide) {
@include span-columns(5 of 6);
@include omega;
}
@include media($narrow) {
@include span-columns(2 of 3);
@include omega;
}
@include media($mobile) {
@include span-columns(3 of 4);
@include omega;
}
}
}
}
// 报名入口
.mod-intro__apply {
@include centered-intro-content;
}
.intro__apply-links {
margin: 1em 0 0;
}
.intro__apply-link {
background-color: #52b0ff;
font-weight: bold;
margin-bottom: 1em;
padding: 0.5em;
&:hover {
background-color: #ffe052;
box-shadow: 0 0.5em 1em rgba(#000, $alpha-hint);
}
@include media($wide) {
@include span-columns(2 of 6);
@include omega(3n);
}
@include media($narrow) {
@include span-columns(1 of 3);
@include omega(3n);
}
@include media($mobile) {
@include span-columns(2);
@include omega(2n);
}
}
// 联系大会
.mod-intro__contact {
@include centered-intro-content;
}
// 大会邮箱链接
.intro__text--contact {
font-family: $font-family-monospace;
font-weight: bold;
font-size: 150%;
@include media($mobile) {
// 320px 宽的设备下右边居然会 clip 掉... 难以置信
// 算了
font-size: 120%;
}
}
// vim:set ai et ts=2 sw=2 sts=2 fenc=utf-8: