Skip to content

Commit d4d8ff6

Browse files
committed
Make learn app notes responsive
1 parent cd57f80 commit d4d8ff6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

learn/templates/learn/layout.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,18 @@ <h5>Preprocessing</h5>
167167
document.getElementById('chapter-link-close').classList.toggle('d-none');
168168
document.getElementById('chapter-link-open').classList.toggle('d-none');
169169
}
170+
// If device width < 768px
171+
if (window.innerWidth < 768) {
172+
const tables = document.querySelectorAll('table');
173+
tables.forEach(table => {
174+
table.classList.add('table-responsive');
175+
});
176+
// Set all img tags to responsive
177+
const imgs = document.querySelectorAll('img');
178+
imgs.forEach(img => {
179+
img.classList.add('img-fluid');
180+
});
181+
}
170182
</script>
171183
{% block script %}{% endblock %}
172184
</body>

main/static/learn/css/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ table.confusion-matrix td.incorrect {
127127
display: none;
128128
}
129129

130+
mjx-container mjx-math {
131+
white-space: normal;
132+
}
133+
130134
@media screen and (max-width: 768px) {
131135
.learn-content {
132136
min-width: 80vw;

0 commit comments

Comments
 (0)