Skip to content

Commit 3cf2404

Browse files
committed
Fix background color of tables
closes #1684
1 parent c912339 commit 3cf2404

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Unreleased
22

3+
### Bug Fixes
4+
5+
- Fix background color of tables in dark mode, closes #1684.
6+
37
## v0.22.1 (2021-08-10)
48

59
### Bug Fixes

examples/basic/src/markdown.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,15 @@
33
* @see https://github.com/TypeStrong/typedoc/issues/1395
44
*/
55
export const emailAddressInComment = true;
6+
7+
/**
8+
* Tables are also supported
9+
*
10+
* | Test | Test |
11+
* | ---- | ---- |
12+
* | 1 | `code` |
13+
* | 2 | [#1684](https://github.com/TypeStrong/typedoc/issues/1684) |
14+
* | 3 | Third row |
15+
* | 4 | Fourth row |
16+
*/
17+
export const table = true;

static/style.css

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
:root {
44
/* Light */
5-
--light-color-background: #fdfdfd;
5+
--light-color-background: #fcfcfc;
6+
--light-color-secondary-background: #fff;
67
--light-color-text: #222;
78
--light-color-text-aside: #707070;
89
--light-color-link: #4da6ff;
910
--light-color-menu-divider: #eee;
1011
--light-color-menu-divider-focus: #000;
1112
--light-color-menu-label: #707070;
12-
--light-color-panel: #fff;
13+
--light-color-panel: var(--light-color-secondary-background);
1314
--light-color-panel-divider: #eee;
1415
--light-color-comment-tag: #707070;
1516
--light-color-comment-tag-text: #fff;
@@ -25,13 +26,14 @@
2526

2627
/* Dark */
2728
--dark-color-background: #36393f;
29+
--dark-color-secondary-background: #2f3136;
2830
--dark-color-text: #ffffff;
2931
--dark-color-text-aside: #e6e4e4;
3032
--dark-color-link: #00aff4;
3133
--dark-color-menu-divider: #eee;
3234
--dark-color-menu-divider-focus: #000;
3335
--dark-color-menu-label: #707070;
34-
--dark-color-panel: #2f3136;
36+
--dark-color-panel: var(--dark-color-secondary-background);
3537
--dark-color-panel-divider: #818181;
3638
--dark-color-comment-tag: #dcddde;
3739
--dark-color-comment-tag-text: #2f3136;
@@ -49,6 +51,7 @@
4951
@media (prefers-color-scheme: light) {
5052
:root {
5153
--color-background: var(--light-color-background);
54+
--color-secondary-background: var(--light-color-secondary-background);
5255
--color-text: var(--light-color-text);
5356
--color-text-aside: var(--light-color-text-aside);
5457
--color-link: var(--light-color-link);
@@ -74,6 +77,7 @@
7477
@media (prefers-color-scheme: dark) {
7578
:root {
7679
--color-background: var(--dark-color-background);
80+
--color-secondary-background: var(--dark-color-secondary-background);
7781
--color-text: var(--dark-color-text);
7882
--color-text-aside: var(--dark-color-text-aside);
7983
--color-link: var(--dark-color-link);
@@ -102,6 +106,7 @@ body {
102106

103107
body.light {
104108
--color-background: var(--light-color-background);
109+
--color-secondary-background: var(--light-color-secondary-background);
105110
--color-text: var(--light-color-text);
106111
--color-text-aside: var(--light-color-text-aside);
107112
--color-link: var(--light-color-link);
@@ -125,6 +130,7 @@ body.light {
125130

126131
body.dark {
127132
--color-background: var(--dark-color-background);
133+
--color-secondary-background: var(--dark-color-secondary-background);
128134
--color-text: var(--dark-color-text);
129135
--color-text-aside: var(--dark-color-text-aside);
130136
--color-link: var(--dark-color-link);
@@ -894,21 +900,21 @@ footer .tsd-legend {
894900
margin-top: 10px;
895901
word-break: normal;
896902
word-break: keep-all;
903+
border-collapse: collapse;
897904
}
898905
.tsd-panel table th {
899906
font-weight: bold;
900907
}
901908
.tsd-panel table th,
902909
.tsd-panel table td {
903910
padding: 6px 13px;
904-
border: 1px solid #ddd;
911+
border: 1px solid var(--color-panel-divider);
905912
}
906913
.tsd-panel table tr {
907-
background-color: #fff;
908-
border-top: 1px solid #ccc;
914+
background: var(--color-background);
909915
}
910-
.tsd-panel table tr:nth-child(2n) {
911-
background-color: #f8f8f8;
916+
.tsd-panel table tr:nth-child(even) {
917+
background: var(--color-secondary-background);
912918
}
913919

914920
.tsd-panel-group {

0 commit comments

Comments
 (0)