Skip to content

Commit 3ed6431

Browse files
close #120 | Allow full width images, tables and code snippets.
1 parent 05714e9 commit 3ed6431

File tree

2 files changed

+121
-78
lines changed

2 files changed

+121
-78
lines changed

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ <h1 id="images-and-videos">Images and videos</h1>
185185
&lt;/section&gt;</code></pre>
186186
<figcaption>
187187
<h1>Code snippet of an image, with a descriptive caption.</h1>
188-
<p>The <code>&lt;figure&gt;</code> element may be avoided if there is no need for a caption, in such a case the <code>&lt;img src="..."&gt;</code> element is a child of the <code>&lt;section&gt;</code> element. The article header may contain a picture as well, which will be full width.</p>
188+
<p>The <code>&lt;figure&gt;</code> element may be avoided if there is no need for a caption, in such a case the <code>&lt;img&gt;</code> element is a child of the <code>&lt;section&gt;</code> element. The article header may contain a picture as well, which will be full width.</p>
189189
</figcaption>
190190
</figure>
191191
<h2>Videos</h2>
@@ -517,7 +517,7 @@ <h1>Maxwell's equations in vacuum.</h1>
517517
<footer>
518518
<section>
519519
<h1>Footnotes</h1>
520-
<p>At the end of the article, you may want to add further information, like additional resources, footnotes, acknowledgements, author contribution, references, updates, corrections and so on. Rapido provides style rules for <strong>headings</strong>, <strong>paragraphs</strong>, <strong>lists</strong> and <strong>code snippets</strong> in the article footer.</p>
520+
<p>At the end of the article, you may want to add further information, like additional resources, footnotes, acknowledgements, author contribution, references, updates, corrections and so on. Rapido provides style rules for <strong>headings</strong>, <strong>paragraphs</strong>, <strong>lists</strong>, <strong>tables</strong> and <strong>code snippets</strong> in the article footer.</p>
521521
<pre><code>&lt;article&gt;
522522
...</code>
523523
<mark><code> &lt;footer&gt;

rapido.css

Lines changed: 119 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ article.rapido {
4747
/* aside */
4848

4949
.rapido section > aside {
50-
width: 100%;
51-
max-width: 600px;
50+
width: 600px;
51+
max-width: 100%;
5252
border-top: 2px solid #353839;
5353
border-bottom: 2px solid #353839;
5454
margin: 0 0 20px 0;
@@ -85,8 +85,8 @@ article.rapido > footer {
8585
/* h1 */
8686

8787
.rapido section > h1 {
88-
width: 100%;
89-
max-width: 600px;
88+
width: 600px;
89+
max-width: 100%;
9090
margin: 0 0 30px 0;
9191
font-size: 30px;
9292
line-height: 45px;
@@ -162,8 +162,8 @@ article.rapido > footer figure > figcaption > h1 {
162162
/* h2 */
163163

164164
.rapido section > h2 {
165-
width: 100%;
166-
max-width: 600px;
165+
width: 600px;
166+
max-width: 100%;
167167
margin: 0 0 20px 0;
168168
font-size: 20px;
169169
line-height: 30px;
@@ -172,7 +172,7 @@ article.rapido > footer figure > figcaption > h1 {
172172

173173
article.rapido > footer > h2,
174174
article.rapido > footer > section > h2 {
175-
max-width: unset;
175+
width: 100%;
176176
margin: 0 0 10px 0;
177177
font-size: 12px;
178178
line-height: 18px;
@@ -209,8 +209,8 @@ article.rapido > footer > section {
209209
/* blockquote */
210210

211211
.rapido section > blockquote {
212-
width: 100%;
213-
max-width: 600px;
212+
width: 600px;
213+
max-width: 100%;
214214
padding: 20px 40px 0 40px;
215215
}
216216

@@ -225,39 +225,51 @@ article.rapido > footer > section {
225225
/* div */
226226

227227
.rapido div {
228-
width: 100%;
229-
max-width: 600px;
228+
display: block;
229+
flex: 0 0 auto;
230+
max-width: 100%;
231+
margin: 0 20px 0 0;
230232
overflow-y: hidden;
231233
overflow-x: auto;
232234
}
233235

234-
.rapido section figure > div {
236+
.rapido > section div {
235237
width: 600px;
236-
max-width: 100%;
237-
overflow-y: hidden;
238-
overflow-x: auto;
239238
}
240239

241-
/* end div */
240+
.rapido > section > div {
241+
margin: 0 0 20px 0;
242+
}
242243

243-
/* figcaption */
244+
.rapido > footer div,
245+
article.rapido > header div {
246+
width: 100%;
247+
}
244248

245-
.rapido section figcaption {
246-
width: 324px;
247-
margin-left: 20px;
249+
article.rapido > header > div {
250+
margin: 0 0 20px 0;
248251
}
249252

250-
@media (max-width: 1023px) {
251-
.rapido section figcaption {
252-
width: 600px;
253-
margin: 5px 0 0 0;
253+
.rapido > footer > section > div {
254+
margin: 0 0 10px 0;
255+
}
256+
257+
@media (min-width: 1024px) {
258+
.rapido > footer > section > div {
259+
width: calc(100% - 200px);
260+
margin: 0 0 10px 200px;
254261
}
255262
}
256263

257-
article.rapido > header > figure > figcaption,
258-
article.rapido > footer > section > figure > figcaption {
259-
width: 100%;
260-
margin: 5px 0 0 0;
264+
/* end div */
265+
266+
/* figcaption */
267+
268+
.rapido figcaption {
269+
flex: 1 1;
270+
min-width: 140px;
271+
max-width: 100%;
272+
margin-top: 3px;
261273
}
262274

263275
/* end figcaption */
@@ -268,7 +280,7 @@ article.rapido > footer > section > figure > figcaption {
268280
display: flex;
269281
flex-wrap: wrap;
270282
align-items: flex-start;
271-
margin: 20px 0 20px 0;
283+
margin: 20px 0;
272284
}
273285

274286
article.rapido > footer figure {
@@ -303,8 +315,8 @@ article.rapido > footer li {
303315

304316
.rapido ol,
305317
.rapido ul {
306-
width: 100%;
307-
max-width: 600px;
318+
width: 600px;
319+
max-width: 100%;
308320
margin: 0 0 20px 0;
309321
list-style-position: inside;
310322
}
@@ -322,17 +334,11 @@ article.rapido > footer ol {
322334
margin: 0;
323335
}
324336

325-
article.rapido > footer > ul,
326-
article.rapido > footer > ol {
327-
max-width: unset;
328-
}
329-
330337
@media (min-width: 1024px) {
331338
article.rapido > footer > section > ol,
332339
article.rapido > footer > section > ul {
333340
margin: 0 0 10px 200px;
334341
width: calc(100% - 200px);
335-
max-width: unset;
336342
}
337343
}
338344

@@ -343,7 +349,8 @@ article.rapido > footer > ol {
343349
.rapido p,
344350
.rapido section p {
345351
position: relative;
346-
max-width: 600px;
352+
width: 600px;
353+
max-width: 100%;
347354
margin: 0 0 20px 0;
348355
font-size: 18px;
349356
line-height: 30px;
@@ -356,7 +363,10 @@ article.rapido > footer > ol {
356363
}
357364

358365
.rapido section figure > p {
359-
width: 600px;
366+
display: block;
367+
flex: 0 0 auto;
368+
height: auto;
369+
margin: 0 20px 0 0;
360370
}
361371

362372
.rapido section > blockquote > p {
@@ -379,28 +389,29 @@ article.rapido > footer > ol {
379389
}
380390

381391
article.rapido > header > p {
382-
max-width: 100%;
392+
width: 100%;
383393
font-size: 30px;
384394
line-height: 45px;
385395
}
386396

387397
.rapido section > aside > p {
398+
width: 100%;
388399
position: relative;
389-
max-width: 600px;
390400
margin: 0 0 20px 0;
391401
font-size: 30px;
392402
line-height: 45px;
393403
}
394404

395405
article.rapido > footer p {
406+
width: 100%;
407+
margin: 0 0 10px 0;
396408
font-size: 12px;
397409
line-height: 18px;
398-
max-width: unset;
399-
margin: 0 0 10px 0;
400410
}
401411

402412
@media (min-width: 1024px) {
403413
article.rapido > footer > section > p {
414+
width: calc(100% - 200px);
404415
margin: 0 0 10px 200px;
405416
}
406417
}
@@ -409,25 +420,29 @@ article.rapido > footer figcaption > p {
409420
padding: 0;
410421
}
411422

412-
article.rapido > footer li > p {
413-
display: inline;
414-
}
415-
416423
@media (max-width: 499px) {
417424
article.rapido > header > p {
418425
font-size: 24px;
419426
line-height: 36px;
420427
}
421428
}
422429

430+
article.rapido > header > figure > figcaption > p {
431+
display: inline;
432+
font-size: 14px;
433+
line-height: 21px;
434+
}
435+
423436
/* end p */
424437

425438
/* pre */
426439

427440
.rapido pre {
428-
width: 600px;
441+
display: block;
442+
flex: 0 0 auto;
429443
max-width: 100%;
430444
padding: 5px 0;
445+
margin: 0 20px 0 0;
431446
overflow-y: hidden;
432447
overflow-x: auto;
433448
border-radius: 2px;
@@ -444,25 +459,36 @@ article.rapido > footer li > p {
444459
line-height: 21px;
445460
}
446461

447-
article.rapido > footer pre {
448-
margin: 10px 0;
462+
.rapido > section pre {
463+
width: 600px;
449464
}
450465

451-
article.rapido > footer pre,
452-
article.rapido > footer figure > pre {
453-
width: 100%;
466+
.rapido > section > pre {
467+
margin: 0 0 20px 0;
468+
}
469+
470+
.rapido > footer pre {
454471
font-size: 12px;
455472
line-height: 18px;
456473
}
457474

458-
article.rapido > footer figure > pre {
459-
margin: 0;
475+
.rapido > footer pre,
476+
article.rapido > header pre {
477+
width: 100%;
478+
}
479+
480+
article.rapido > header > pre {
481+
margin: 0 0 20px 0;
482+
}
483+
484+
.rapido > footer > section > pre {
485+
margin: 0 0 10px 0;
460486
}
461487

462488
@media (min-width: 1024px) {
463-
article.rapido > footer > section > pre {
464-
margin: 10px 0 10px 200px;
489+
.rapido > footer > section > pre {
465490
width: calc(100% - 200px);
491+
margin: 0 0 10px 200px;
466492
}
467493
}
468494

@@ -605,6 +631,16 @@ article.rapido > footer pre > mark > code {
605631

606632
/* img, video */
607633

634+
.rapido img,
635+
.rapido video {
636+
display: block;
637+
flex: 0 0 auto;
638+
max-width: 100%;
639+
height: auto;
640+
margin: 0 20px 0 0;
641+
border-radius: 2px;
642+
}
643+
608644
.rapido p > img {
609645
vertical-align: middle;
610646
}
@@ -621,32 +657,39 @@ article.rapido > footer pre > mark > code {
621657
}
622658
}
623659

624-
.rapido section > img,
625-
.rapido section > video,
626-
.rapido section figure > img,
627-
.rapido section figure > video {
628-
display: block;
629-
flex: 0 0 auto;
660+
.rapido > section img,
661+
.rapido > section video {
630662
width: 600px;
631-
max-width: 100%;
632-
height: auto;
633-
box-shadow: 0 0 15px -5px rgba(0, 0, 0, 0.23);
634-
border-radius: 3px;
663+
}
664+
665+
.rapido > section > img,
666+
.rapido > section > video {
667+
margin: 0 0 20px 0;
668+
}
669+
670+
.rapido > footer img,
671+
.rapido > footer video,
672+
article.rapido > header img,
673+
article.rapido > header video {
674+
width: 100%;
635675
}
636676

637677
article.rapido > header > img,
638678
article.rapido > header > video {
639-
margin: 20px 0 20px 0;
679+
margin: 0 0 20px 0;
640680
}
641681

642-
article.rapido > header > img,
643-
article.rapido > header > video,
644-
article.rapido > header > figure > img,
645-
article.rapido > header > figure > video {
646-
display: block;
647-
width: 100%;
648-
border-radius: 3px;
649-
box-shadow: 0 0 15px -5px rgba(0, 0, 0, 0.23);
682+
.rapido > footer > section > img,
683+
.rapido > footer > section > video {
684+
margin: 0 0 10px 0;
685+
}
686+
687+
@media (min-width: 1024px) {
688+
.rapido > footer > section > img,
689+
.rapido > footer > section > video {
690+
width: calc(100% - 200px);
691+
margin: 0 0 10px 200px;
692+
}
650693
}
651694

652695
article.rapido > header > address > img {

0 commit comments

Comments
 (0)