|
| 1 | +/* Based on the stylesheet used by matrepr (https://github.com/alugowski/matrepr) and modified for sphinx */ |
| 2 | + |
| 3 | +table.matrix { |
| 4 | + border-collapse: collapse; |
| 5 | + border: 0px; |
| 6 | +} |
| 7 | + |
| 8 | +/* Disable a horizintal line from the default stylesheet */ |
| 9 | +.table.matrix > :not(caption) > * > * { |
| 10 | + border-bottom-width: 0px; |
| 11 | +} |
| 12 | + |
| 13 | +/* row indices */ |
| 14 | +table.matrix > tbody tr th { |
| 15 | + font-size: smaller; |
| 16 | + font-weight: bolder; |
| 17 | + vertical-align: middle; |
| 18 | + text-align: right; |
| 19 | +} |
| 20 | +/* row indices are often made bold in the source data; here make them match the boldness of the th column label style*/ |
| 21 | +table.matrix strong { |
| 22 | + font-weight: bold; |
| 23 | +} |
| 24 | + |
| 25 | +/* column indices */ |
| 26 | +table.matrix > thead tr th { |
| 27 | + font-size: smaller; |
| 28 | + font-weight: bolder; |
| 29 | + vertical-align: middle; |
| 30 | + text-align: center; |
| 31 | +} |
| 32 | + |
| 33 | +/* cells */ |
| 34 | +table.matrix > tbody tr td { |
| 35 | + vertical-align: middle; |
| 36 | + text-align: center; |
| 37 | + position: relative; |
| 38 | +} |
| 39 | + |
| 40 | +/* left border */ |
| 41 | +table.matrix > tbody tr td:first-of-type { |
| 42 | + border-left: solid 2px var(--pst-color-text-base); |
| 43 | +} |
| 44 | +/* right border */ |
| 45 | +table.matrix > tbody tr td:last-of-type { |
| 46 | + border-right: solid 2px var(--pst-color-text-base); |
| 47 | +} |
| 48 | + |
| 49 | +/* prevents empty cells from collapsing, especially empty rows */ |
| 50 | +table.matrix > tbody tr td:empty::before { |
| 51 | + /* basicaly fills empty cells with */ |
| 52 | + content: "\00a0\00a0\00a0"; |
| 53 | + visibility: hidden; |
| 54 | +} |
| 55 | +table.matrix > tbody tr td:empty::after { |
| 56 | + content: "\00a0\00a0\00a0"; |
| 57 | + visibility: hidden; |
| 58 | +} |
| 59 | + |
| 60 | +/* matrix bracket ticks */ |
| 61 | +table.matrix > tbody > tr:first-child > td:first-of-type::before { |
| 62 | + content: ""; |
| 63 | + width: 4px; |
| 64 | + position: absolute; |
| 65 | + top: 0; |
| 66 | + bottom: 0; |
| 67 | + visibility: visible; |
| 68 | + left: 0; |
| 69 | + right: auto; |
| 70 | + border-top: solid 2px var(--pst-color-text-base); |
| 71 | +} |
| 72 | +table.matrix > tbody > tr:last-child > td:first-of-type::before { |
| 73 | + content: ""; |
| 74 | + width: 4px; |
| 75 | + position: absolute; |
| 76 | + top: 0; |
| 77 | + bottom: 0; |
| 78 | + visibility: visible; |
| 79 | + left: 0; |
| 80 | + right: auto; |
| 81 | + border-bottom: solid 2px var(--pst-color-text-base); |
| 82 | +} |
| 83 | +table.matrix > tbody > tr:first-child > td:last-of-type::after { |
| 84 | + content: ""; |
| 85 | + width: 4px; |
| 86 | + position: absolute; |
| 87 | + top: 0; |
| 88 | + bottom: 0; |
| 89 | + visibility: visible; |
| 90 | + left: auto; |
| 91 | + right: 0; |
| 92 | + border-top: solid 2px var(--pst-color-text-base); |
| 93 | +} |
| 94 | +table.matrix > tbody > tr:last-child > td:last-of-type::after { |
| 95 | + content: ""; |
| 96 | + width: 4px; |
| 97 | + position: absolute; |
| 98 | + top: 0; |
| 99 | + bottom: 0; |
| 100 | + visibility: visible; |
| 101 | + left: auto; |
| 102 | + right: 0; |
| 103 | + border-bottom: solid 2px var(--pst-color-text-base); |
| 104 | +} |
0 commit comments