Better better tables

This commit is contained in:
Hamcha 2020-06-17 10:33:49 +02:00
parent 39d5ffab57
commit e3dbfb4e70
Signed by: hamcha
GPG Key ID: 41467804B19A3315
5 changed files with 19 additions and 9 deletions

View File

@ -33,13 +33,6 @@ export default function WikiPage({ page, visible }) {
} }
}, [data]); }, [data]);
// Page fetched, instance userscript
useEffect(() => {
if (data.loaded) {
console.log(page + ": loaded!");
}
}, [data]);
if (!data.loaded) { if (!data.loaded) {
return ( return (
<div <div

View File

@ -265,7 +265,7 @@ export default function (root: HTMLElement, docname: string) {
// Ideally I'd like a <p> or something on every part, wrapping it completely, but for now let's just kill 'em // Ideally I'd like a <p> or something on every part, wrapping it completely, but for now let's just kill 'em
document document
.querySelectorAll( .querySelectorAll(
"table.wikitable > tbody > tr:not(:first-child) > td:nth-child(2)" "table.wikitable > tbody > tr:not(:first-child) > td:nth-child(2), .tooltiptext"
) )
.forEach((td) => { .forEach((td) => {
const tmp = td.cloneNode(); const tmp = td.cloneNode();
@ -397,6 +397,7 @@ export default function (root: HTMLElement, docname: string) {
const row = el.querySelectorAll("th"); const row = el.querySelectorAll("th");
row.forEach((th, i) => { row.forEach((th, i) => {
if (i < 2) { if (i < 2) {
th.classList.add("table-head");
return; return;
} }
th.parentElement.removeChild(th); th.parentElement.removeChild(th);

View File

@ -1,3 +1,5 @@
@import "vars.scss";
.bgus_hidden { .bgus_hidden {
display: none !important; display: none !important;
} }
@ -72,11 +74,24 @@ span.bgus_nested_element:not(.bgus_collapsed) + div.tooltiptext {
font-size: 8pt; font-size: 8pt;
padding: 5px 8px; padding: 5px 8px;
line-height: 10pt; line-height: 10pt;
div.tooltiptext {
margin-left: -5px;
}
} }
.bchem table.wikitable > tbody > tr > td:nth-child(2) { .bchem table.wikitable > tbody > tr > td:nth-child(2) {
width: 45%; width: 45%;
padding: 10px; padding: 10px;
} }
.bchem table.wikitable {
border: 0 !important;
.table-head {
text-align: center;
}
th {
background-color: darken($nanotrasen, 5%) !important;
}
}
.bgus_fz_selected { .bgus_fz_selected {
border: 3px solid yellow; border: 3px solid yellow;
} }

View File

@ -1,4 +1,4 @@
$nanotrasen: #384e68; @import "vars.scss";
html, html,
body { body {

1
style/vars.scss Normal file
View File

@ -0,0 +1 @@
$nanotrasen: #384e68;