Skip to content

Commit 7364d41

Browse files
committed
Style tables, different header bg, alternate row color and border
1 parent f6be4a7 commit 7364d41

File tree

7 files changed

+106
-42
lines changed

7 files changed

+106
-42
lines changed

src/theme/book.css

Lines changed: 65 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ h5 {
2727
}
2828
table {
2929
margin: 0 auto;
30-
}
31-
table thead td {
32-
font-weight: 700;
30+
border-collapse: collapse;
3331
}
3432
table td {
3533
padding: 3px 20px;
34+
border: 1px solid;
35+
}
36+
table thead td {
37+
font-weight: 700;
3638
}
3739
.sidebar {
3840
position: absolute;
@@ -296,14 +298,6 @@ table td {
296298
.light {
297299
color: #333;
298300
background-color: #fff;
299-
/*
300-
table {
301-
thead td {
302-
color: $table-header-fg;
303-
backrgound: $table-header-bg;
304-
}
305-
}
306-
*/
307301
/* Inline code */
308302
}
309303
.light .content .header:link,
@@ -375,6 +369,21 @@ table td {
375369
border-top: 0.1em solid #e1edf1;
376370
border-bottom: 0.1em solid #e1edf1;
377371
}
372+
.light table td {
373+
border-color: #f2f2f2;
374+
}
375+
.light table tbody tr:nth-child(2n) {
376+
background: #f7f7f7;
377+
}
378+
.light table thead {
379+
background: #ccc;
380+
}
381+
.light table thead td {
382+
border: none;
383+
}
384+
.light table thead tr {
385+
border: 1px #ccc solid;
386+
}
378387
.light :not(pre) > .hljs {
379388
display: inline-block;
380389
vertical-align: middle;
@@ -404,14 +413,6 @@ table td {
404413
.coal {
405414
color: #98a3ad;
406415
background-color: #141617;
407-
/*
408-
table {
409-
thead td {
410-
color: $table-header-fg;
411-
backrgound: $table-header-bg;
412-
}
413-
}
414-
*/
415416
/* Inline code */
416417
}
417418
.coal .content .header:link,
@@ -483,6 +484,21 @@ table td {
483484
border-top: 0.1em solid #2c2f44;
484485
border-bottom: 0.1em solid #2c2f44;
485486
}
487+
.coal table td {
488+
border-color: #1f2223;
489+
}
490+
.coal table tbody tr:nth-child(2n) {
491+
background: #1b1d1e;
492+
}
493+
.coal table thead {
494+
background: #3f4649;
495+
}
496+
.coal table thead td {
497+
border: none;
498+
}
499+
.coal table thead tr {
500+
border: 1px #3f4649 solid;
501+
}
486502
.coal :not(pre) > .hljs {
487503
display: inline-block;
488504
vertical-align: middle;
@@ -512,14 +528,6 @@ table td {
512528
.navy {
513529
color: #bcbdd0;
514530
background-color: #161923;
515-
/*
516-
table {
517-
thead td {
518-
color: $table-header-fg;
519-
backrgound: $table-header-bg;
520-
}
521-
}
522-
*/
523531
/* Inline code */
524532
}
525533
.navy .content .header:link,
@@ -591,6 +599,21 @@ table td {
591599
border-top: 0.1em solid #2f333f;
592600
border-bottom: 0.1em solid #2f333f;
593601
}
602+
.navy table td {
603+
border-color: #1f2331;
604+
}
605+
.navy table tbody tr:nth-child(2n) {
606+
background: #1b1f2b;
607+
}
608+
.navy table thead {
609+
background: #39415b;
610+
}
611+
.navy table thead td {
612+
border: none;
613+
}
614+
.navy table thead tr {
615+
border: 1px #39415b solid;
616+
}
594617
.navy :not(pre) > .hljs {
595618
display: inline-block;
596619
vertical-align: middle;
@@ -620,14 +643,6 @@ table td {
620643
.rust {
621644
color: #262625;
622645
background-color: #e1e1db;
623-
/*
624-
table {
625-
thead td {
626-
color: $table-header-fg;
627-
backrgound: $table-header-bg;
628-
}
629-
}
630-
*/
631646
/* Inline code */
632647
}
633648
.rust .content .header:link,
@@ -699,6 +714,21 @@ table td {
699714
border-top: 0.1em solid #b8b8b1;
700715
border-bottom: 0.1em solid #b8b8b1;
701716
}
717+
.rust table td {
718+
border-color: #d7d7cf;
719+
}
720+
.rust table tbody tr:nth-child(2n) {
721+
background: #dbdbd4;
722+
}
723+
.rust table thead {
724+
background: #b3a497;
725+
}
726+
.rust table thead td {
727+
border: none;
728+
}
729+
.rust table thead tr {
730+
border: 1px #b3a497 solid;
731+
}
702732
.rust :not(pre) > .hljs {
703733
display: inline-block;
704734
vertical-align: middle;

src/theme/stylus/general.styl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ h4, h5 { margin-top: 2em }
2222

2323
table {
2424
margin: 0 auto;
25+
border-collapse: collapse;
2526

26-
thead td { font-weight: 700; }
27-
td { padding: 3px 20px; }
27+
td {
28+
padding: 3px 20px;
29+
border: 1px solid;
30+
}
31+
32+
thead {
33+
td { font-weight: 700; }
34+
}
2835
}

src/theme/stylus/themes/base.styl

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,25 @@
7979
border-bottom: .1em solid $quote-border;
8080
}
8181

82-
/*
82+
8383
table {
84-
thead td {
85-
color: $table-header-fg;
86-
backrgound: $table-header-bg;
84+
85+
td {
86+
border-color: $table-border-color;
87+
}
88+
89+
// Alternate background colors for rows
90+
tbody tr:nth-child(2n) {
91+
background: $table-alternate-bg;
92+
}
93+
94+
thead {
95+
background: $table-header-bg;
96+
td { border: none; }
97+
tr { border: 1px $table-header-bg solid; }
8798
}
8899
}
89-
*/
100+
90101

91102
/* Inline code */
92103
:not(pre) > .hljs {

src/theme/stylus/themes/coal.styl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ $theme-hover = #1f2124
2121
$quote-bg = #242637
2222
$quote-border = lighten($quote-bg, 5%)
2323

24+
$table-border-color = lighten($bg, 5%)
25+
$table-header-bg = lighten($bg, 20%)
26+
$table-alternate-bg = lighten($bg, 3%)
27+
2428
@import 'base'

src/theme/stylus/themes/light.styl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ $theme-hover = #e6e6e6
2121
$quote-bg = #f2f7f9
2222
$quote-border = darken($quote-bg, 5%)
2323

24+
$table-border-color = darken($bg, 5%)
25+
$table-header-bg = darken($bg, 20%)
26+
$table-alternate-bg = darken($bg, 3%)
27+
2428
@import 'base'

src/theme/stylus/themes/navy.styl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ $theme-hover = #282e40
2121
$quote-bg = #262933
2222
$quote-border = lighten($quote-bg, 5%)
2323

24+
$table-border-color = lighten($bg, 5%)
25+
$table-header-bg = lighten($bg, 20%)
26+
$table-alternate-bg = lighten($bg, 3%)
27+
2428
@import 'base'

src/theme/stylus/themes/rust.styl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ $theme-hover = #99908a
2121
$quote-bg = #c1c1bb
2222
$quote-border = darken($quote-bg, 5%)
2323

24+
$table-border-color = darken($bg, 5%)
25+
$table-header-bg = #b3a497
26+
$table-alternate-bg = darken($bg, 3%)
27+
2428
@import 'base'

0 commit comments

Comments
 (0)