forked from PreTeXtBook/CSS_core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
style_oscarlevin.css
458 lines (393 loc) · 12.6 KB
/
style_oscarlevin.css
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
:root {
/* Set colors for environments */
--assembbody: var(--bluelight, hsl(210, 90%, 80%));
--assembborder: var(--blue, hsl(210, 40%, 60%));
--assembhead: var(--blue, hsl(210, 40%, 60%));
--definitionbody: var(--greenlight, hsl(180, 40%, 80%));
--definitionborder: var(--green, hsl(180, 40%, 50%));
--definitionhead: var(--green, hsl(180, 40%, 50%));
--theorembody: var(--violetlight, hsl(270, 40%, 94%));
--theoremborder: var(--violet, hsl(270, 40%, 75%));
--theoremhead: var(--violetdark, hsl(270, 40%, 25%));
--examplebody: var(--bluedull, hsl(240, 40%, 90%));
--exampleborder: var(--bluedark, hsl(240, 40%, 25%));
--examplehead: var(--exampleborder);
--examplelikebody: var(--examplebody);
--examplelikeborder: var(--bluedull, hsl(240, 40%, 75%));
--examplelikehead: var(--examplelikeborder);
--projectbody: var(--greenlight, hsl(180, 40%, 94%));
--projectborder: var(--green, hsl(180, 40%, 75%));
--projecthead: var(--green, hsl(180, 40%, 75%));
--investigateborder: var(--bluerich, hsl(180, 40%, 25%));
--goalborder: var(--violetrich, hsl(270, 90%, 25%));
--remarklikebody: var(--yellowlight, hsl(59, 55%, 85%));
--remarklikeborder: var(--yellow, hsl(59, 55%, 50%));
--remarklikehead: var(--yellow, hsl(59, 55%, 50%));
--computationborder: var(--orangedull, hsl(180, 40%, 75%));
/* temporary workaround for setcolors.css use of assemblage */
--asemblagebackground: var(--assembbody) !important;
--assemblageborder: var(--assembborder) !important;
}
/* We can style all the *-like environments:
definition-like,
theorem-like,
example-like,
project-like,
remark-like,
computation-like,
goal-like, and
assemblage-like.
We also could do something for proofs, and commentary.
(should we style aside-like? Or just copy from style_default?)
We define the style of environments in three steps: first the shape, then the color, and finally the shape and color of the heading/title. The only reason to group these as such is that we can then have a common shape for differet *-like elements, but still allow for different colors to distinguish them.
Start with the important custom environments (theorem might be different from the other theorem-like, etc.), then clean up any standard *-like.
*/
/* definitions, theorems, assemblages, with theorem-like.theorem distinguished */
.pretext-content .assemblage-like,
.pretext-content .definition-like,
.pretext-content .theorem-like.theorem {
margin-top: 1.75em;
padding: 1em;
border-radius: 2px;
margin-bottom: 1em;
}
.pretext-content .theorem-like {
margin-top: 1.25em;
padding: 1em;
border-radius: 2px;
margin-bottom: 1em;
}
.pretext-content .assemblage-like{
background-color: var(--assembbody);
border: 2px solid var(--assembborder);
}
.pretext-content .definition-like {
background-color: var(--definitionbody);
border: 2px solid var(--definitionborder);
}
.pretext-content .theorem-like.theorem,
.pretext-content .theorem-like {
background-color: var(--theorembody);
border: 2px solid var(--theoremborder);
}
.pretext-content .assemblage-like .heading,
.pretext-content .definition-like .heading,
.pretext-content .theorem-like.theorem .heading {
margin-top: -1.75em;
margin-left: -0.25em;
display: table;
padding: 0.25em 0.4em;
}
.pretext-content .assemblage-like .heading {
background-color: var(--assembhead);
color: #000;
}
.pretext-content .definition-like .heading {
background-color: var(--definitionborder);
color: #000;
}
.pretext-content .theorem-like.theorem .heading {
background-color: var(--theoremborder);
color: #000;
}
.pretext-content .assemblage-like .heading + p,
.pretext-content .theorem-like.theorem .heading + p,
.pretext-content .definition-like .heading + p {
display: block;
margin-top: .5em;
}
/* Examples and example-like; computation-like styled same as example-like with different colors */
.pretext-content .example-like,
.pretext-content .computation-like {
padding-left: 0.8em;
padding-bottom: 0.5em;
}
.pretext-content .example-like.example {
border-left: 0.1em solid var(--examplehead);
border-bottom: 0.1em solid var(--examplehead);
}
.pretext-content .example-like {
border-left: 0.1em solid var(--examplelikeborder);
border-bottom: 0.1em solid var(--examplelikeborder);
}
.pretext-content .computation-like {
border-left: 0.1em solid var(--computationborder);
border-bottom: 0.1em solid var(--computationborder);
}
.pretext-content .example-like > .heading,
.pretext-content .computation-like > .heading {
display: inline-block;
padding: 0.3em 0.5em;
margin-left: -0.8em;
}
.pretext-content .example-like.example > .heading {
border: 0.1em solid var(--examplehead); /* maybe no border-left? */
background: var(--examplehead);
color: white;
}
.pretext-content .example-like > .heading {
background: var(--examplelikeborder);
color: black;
}
.pretext-content .computation-like > .heading {
background: var(--computationborder);
color: black;
}
.pretext-content .example-like > .heading + p,
.pretext-content .computation-like > .heading + p,
.pretext-content .example-like > .heading + .introduction,
.pretext-content .computation-like > .heading + .introduction {
display: block;
padding-top: 0.3em;
}
/* Project-like */
.pretext-content .project-like {
background-color: white;
border: solid 3px var(--projectborder);
border-radius: 10px;
padding: 10px;
margin-bottom: 1em;
}
.pretext-content .project-like.investigation {
border-color: var(--investigateborder);
}
.pretext-content .project-like > .heading {
margin-top: -1.5em;
background-color: white;
display: table !important;
padding: 5px 1em;
margin-left: 10px;
font-style: italic;
font-size: 120% !important;
}
/* Goal-like */
.pretext-content .goal-like {
background-color: white;
border-radius: 0em;
padding: 0.7em;
margin-bottom: 1em;
}
.pretext-content .goal-like.objectives {
border-top: solid 3px var(--goalborder);
border-bottom: solid 3px var(--goalborder);
}
.pretext-content .goal-like.outcomes {
border-top: solid 3px var(--goalborder);
border-bottom: solid 3px var(--goalborder);
}
.pretext-content .goal-like .heading {
margin-top: -1.5em;
background-color: white;
display: table;
padding: 5px 1em;
margin-left: 10px;
font-style: italic;
font-size: 120%;
}
/* remark-like */
.pretext-content .remark-like {
margin-top: 1.25em;
padding: 1em;
margin-bottom: 1em;
border-radius: 0px;
border-left: 5px solid var(--remarklikeborder);
background-color: var(--remarklikebody);
}
/* proofs */
.pretext-content section > .proof {
margin-bottom: 1em;
}
/* Common fixes? */
.pretext-content .assemblage-like .heading::after,
.pretext-content .theorem-like.theorem .heading::after,
.pretext-content .theorem-like .heading::after,
.pretext-content .example-like > .heading::after,
.pretext-content .project-like > .heading::after {
content: "";
}
/* Fixes for mathjax: */
/* These gradients need to be adjusted to match background colors */
.pretext-content .assemblage-like .MJXc-display,
.pretext-content .definition-like .MJXc-display,
.pretext-content .theorem-like.theorem .MJXc-display {
background-image: linear-gradient(to right, #e9eff5, #e9eff5), linear-gradient(to right, #e9eff5, #e9eff5), linear-gradient(to right, rgba(0,0,0,.25), rgba(242,242,254,0)), linear-gradient(to left, rgba(0,0,0,.25), rgba(242,242,254,0));
}
.pretext-content .theorem-like.corollary .MJXc-display {
background-image: linear-gradient(to right, var(--bodytitlehighlight), var(--bodytitlehighlight)), linear-gradient(to right, var(--bodytitlehighlight), var(--bodytitlehighlight)), linear-gradient(to right, rgba(0,0,0,.25), rgba(242,242,254,0)), linear-gradient(to left, rgba(0,0,0,.25), rgba(242,242,254,0));
}
/*
END OF STYLE_OSCARLEVIN
(below is only stuff copied from style_default)
*/
/* Assides, copied directly from style_default.css */
/* next selector first part of the following is due to the mistake of
putting paragraph spacing in the margin-bottom
Redo when we fix that error */
.pretext-content .aside-like {
/* margin-top: -1.25em;
*/
position: absolute;
margin-left: 45%;
z-index: -10;
overflow-x: hidden;
max-width: 495px;
max-height: 7em;
overflow-y: hidden;
border: none;
padding: 4px 10px 0 10px;
color: #888;
}
.pretext-content .example-like .aside-like {
margin-top: 0;
position: absolute;
}
.pretext-content .aside-like {
font-size: 90%;
}
.pretext-content .aside-like {
margin-bottom: 5px;
background-color: #f5faff;
box-shadow: 0 0 1.0em 0.2em #fff inset;
}
.pretext-content .aside-like:first-child {
margin-top: -2.25em;
}
.pretext-content .aside-like:after {
content : "";
position : absolute;
z-index : 1;
top : 0em;
bottom : 0;
left : 0;
pointer-events : none;
background-image : linear-gradient(to bottom,
rgba(255,255,255, 0.4),
rgba(255,255,255, 1) 90%);
width : 550px;
height : 8em;
}
/* example of where the following is needed? */
/*
.pretext-content .aside-like * {
background-color: #f5faff !important;
}
*/
.pretext-content .aside-like.front, .pretext-content .example-like .aside-like.front {
position: relative;
z-index: 0;
padding: 8px 15px 10px 15px;
padding: 2px 10px;
margin: 5px 0px 5px 10px;
border: 2px solid #dcebfa;
max-height: none;
max-width: 550px;
color: inherit;
font-size: 100%;
box-shadow: none;
}
.pretext-content .aside-like.front:after, .pretext-content .example-like .aside-like.front:after {
background-image: none;
}
.pretext-content .example-like .aside-like.front {
margin-top: 1.25em;
}
.pretext-content .aside-like.front + p{
margin-top: 1.25em !important;
padding-top: 0;
}
.pretext-content .aside-like .aside-like {
background-color: #fafff5;
border: 1px dotted #aaa;
}
.pretext-content article.aside-like > p:first-child {
margin-top: 0;
}
.pretext-content .aside-like > .heading {
font-size: 95%;
}
.pretext-content .aside-like + *{
margin-top: 3em !important;
margin-right: 3em;
}
/* on sufficiently large screens, there is enough of a margin to see part of the aside */
@media screen and (min-width: 943px) {
.pretext-content .aside-like + * {
margin-right: 0;
}
}
/* on a wide screen, asides should appear in the right margin */
@media screen and (min-width: 1100px) {
.pretext-content .aside-like, .pretext-content .aside-like.front, .pretext-content .example-like .aside-like, .pretext-content .example-like .aside-like.front {
position: absolute;
margin-top: -2em;
margin-left: 660px;
max-width: 200px; /* for some reason the width was too small, so I had to put width (next line) */
width: 200px;
color: inherit;
}
.pretext-content .aside-like.front, .pretext-content .example-like .aside-like.front {
max-height: none;
max-width: 223px;
border: 2px solid #dcebfa;
}
.pretext-content .example-like .aside-like, .pretext-content .example-like .aside-like.front {
margin-left: 654px; /* because .example-like has 6px of padding */
}
.pretext-content .aside-like + * {
margin-top: 1.25em !important;
/* background: none; */
margin-right: 0;
}
.pretext-content .aside-like.front:after, .pretext-content .example-like .aside-like.front:after {
background-image: none;
}
.pretext-content .aside-like:nth-of-type(3n+1) {
margin-left: 660px;
}
.pretext-content .aside-like:nth-of-type(3n) {
margin-left: 680px;
}
.pretext-content .aside-like:nth-of-type(3n+2) {
margin-left: 640px;
}
}
.pretext-content .aside-like:hover:after, .pretext-content .aside-like:focus:after {
top: 3em;
height: auto;
background-image : none;
}
.pretext-content .aside-like:hover, .pretext-content .aside-like:focus {
color: inherit;
padding: 2px 8px 0 8px;
border: 2px solid #dcebfa;
height: auto;
max-height: none;
}
.pretext-content .aside-like.front:hover, .pretext-content .aside-like.front:focus {
padding: 4px 10px;
}
/* find a better way to handle asides in content that has a wide left margin */
/* see http://pretext.jahrme.com/aside-in-knowl/section-1.html */
.pretext-content section dl dd .aside-like {
margin-top: 0 !important;
margin-left: 100px !important;
}
.pretext-content section dl dd .aside-like.front {
margin-left: -300px !important;
}
@media screen and (max-width: 1099px) {
.pretext-content aside.aside-like {
position: relative;
float: right;
z-index: 0;
overflow-x: hidden;
margin-left: 1em;
margin-top: 1em;
max-width: 195px;
max-height: 4em;
margin-right: -8em;
}
.pretext-content li > aside.aside-like:last-child {
position: absolute;
}
}