Added heading links.

This commit is contained in:
Greenscreener
2019-07-16 14:29:05 +02:00
parent 61a06697f0
commit 7e3ecdd450
5 changed files with 38 additions and 4 deletions
+9 -2
View File
@@ -73,7 +73,7 @@ $primary: #0b2a37;
.pageHeader {
margin-bottom: 40px;
}
.content h1, h2, h3, h4, h5, h6, .title {
h1,h2,h3,h4,h5,h6,.title {
font-weight: 300;
}
h2 a {
@@ -88,4 +88,11 @@ h2 a {
.separateWithCommas + .separateWithCommas:before {
content: ", ";
}
// /Custom styles
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6, .content .title {
font-weight: 300;
}
.header-link {
margin-right: 5px;
color: $link;
}
// /Custom styles
+10
View File
@@ -0,0 +1,10 @@
document.addEventListener("DOMContentLoaded", () => {
const headings = document.querySelectorAll(".content h1, .content h2, .content h3, .content h4, .content h5, .content h6");
headings.forEach(e => {
const a = document.createElement("a");
a.href = "#" + e.id;
a.innerText = "#";
a.classList.add("header-link");
e.prepend(a);
});
});