Skip to content

Commit bbc158e

Browse files
committed
Updated notes.css.
Change image parsing to fit page width.
1 parent 5fd06b3 commit bbc158e

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

css/notes.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,17 @@ nav.table-of-contents a:hover,
100100
/* Dark mode variants */
101101
.dark-mode nav.table-of-contents,
102102
.dark-mode .table-of-contents {
103-
border-left-color: var(--border-color, #444);
103+
border-left: 1px solid var(--border-color, #ccc);
104104
}
105105

106106
.dark-mode nav.table-of-contents a,
107107
.dark-mode .table-of-contents a {
108-
color: var(--link-color);
109-
border-left-color: var(--border-color);
108+
color: var(--link-color, #88aaff);
109+
border-left: 1px solid var(--border-color, #ccc);
110110
}
111111

112112
.dark-mode nav.table-of-contents a:hover,
113113
.dark-mode .table-of-contents a:hover {
114-
color: var(--link-hover-color);
115114
text-decoration: underline;
116115
}
117116

@@ -161,4 +160,9 @@ nav.table-of-contents a:hover,
161160
.table-wrapper td {
162161
border: 1px solid #ccc;
163162
padding: 0.5em 1em;
163+
}
164+
165+
.dark-mode .table-wrapper th,
166+
.dark-mode .table-wrapper td {
167+
background: #0e0e0e
164168
}

notes/js/note.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ fetch(`/notes/courses/${course}/${noteSlug}.md`)
6161
const contentDiv = document.createElement("div");
6262
contentDiv.innerHTML = sanitize(dirty);
6363

64+
contentDiv.querySelectorAll('img').forEach(img => {
65+
img.style.display = 'block';
66+
img.style.maxWidth = '100%';
67+
img.style.height = 'auto';
68+
img.style.margin = '0 auto';
69+
});
70+
6471
const tocEntries = [];
6572

6673
contentDiv.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(h => {

0 commit comments

Comments
 (0)