Better better tables
This commit is contained in:
parent
39d5ffab57
commit
e3dbfb4e70
5 changed files with 19 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$nanotrasen: #384e68;
|
||||
@import "vars.scss";
|
||||
|
||||
html,
|
||||
body {
|
||||
|
|
1
style/vars.scss
Normal file
1
style/vars.scss
Normal file
|
@ -0,0 +1 @@
|
|||
$nanotrasen: #384e68;
|
Reference in a new issue