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]);
// Page fetched, instance userscript
useEffect(() => {
if (data.loaded) {
console.log(page + ": loaded!");
}
}, [data]);
if (!data.loaded) {
return (
<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
document
.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) => {
const tmp = td.cloneNode();
@ -397,6 +397,7 @@ export default function (root: HTMLElement, docname: string) {
const row = el.querySelectorAll("th");
row.forEach((th, i) => {
if (i < 2) {
th.classList.add("table-head");
return;
}
th.parentElement.removeChild(th);

View file

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

View file

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

1
style/vars.scss Normal file
View file

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