Skip to content

Commit 82c2101

Browse files
committed
mobile improvements
1 parent 7536033 commit 82c2101

File tree

4 files changed

+73
-2
lines changed

4 files changed

+73
-2
lines changed

_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ <h2 class="text-delta">Table of contents</h2>
202202
<script src="/assets/js/clipboard.min.js"></script>
203203
<script>
204204
document.addEventListener('DOMContentLoaded', function() {
205-
document.querySelectorAll('.highlight').forEach(function(block) {
205+
document.querySelectorAll('div.highlight').forEach(function(block) {
206206
var btn = document.createElement('button');
207207
btn.className = 'copy-btn';
208208
btn.textContent = 'Copy';

_sass/custom/custom.scss

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ img {
298298
flex: 1;
299299
min-width: 0;
300300
max-width: 750px;
301+
302+
@media (max-width: 800px) {
303+
max-width: 100%;
304+
}
301305
}
302306

303307
.toc-sidebar {
@@ -604,3 +608,53 @@ p.text-delta + ul#markdown-toc {
604608
}
605609
}
606610

611+
// =============================================================================
612+
// Mobile Responsive Fixes
613+
// =============================================================================
614+
615+
@media (max-width: 900px) {
616+
// Fix horizontal overflow on mobile
617+
.main {
618+
max-width: 100% !important;
619+
width: 100%;
620+
overflow-x: hidden;
621+
}
622+
623+
.main-content-wrap {
624+
max-width: 100% !important;
625+
padding-left: 15px;
626+
padding-right: 15px;
627+
}
628+
629+
.content-with-toc {
630+
max-width: 100%;
631+
}
632+
633+
.main-content table {
634+
display: block;
635+
overflow-x: auto;
636+
-webkit-overflow-scrolling: touch;
637+
max-width: 100%;
638+
}
639+
640+
// Code blocks on mobile - ensure they stay within container and scroll
641+
div.highlight {
642+
max-width: 100%;
643+
overflow-x: auto;
644+
-webkit-overflow-scrolling: touch;
645+
646+
pre {
647+
max-width: 100%;
648+
}
649+
650+
code {
651+
white-space: pre;
652+
}
653+
}
654+
655+
// Hide copy button on mobile
656+
.copy-btn {
657+
display: none !important;
658+
}
659+
}
660+

assets/css/syntax.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,20 @@ pre code {
267267
background: #585b70;
268268
}
269269

270+
/* Mobile Responsive Styles */
271+
@media (max-width: 800px) {
272+
/* Hide copy button on mobile (no hover on touch devices) */
273+
.copy-btn {
274+
display: none;
275+
}
276+
277+
/* Fix code block overflow */
278+
.highlight {
279+
max-width: 100%;
280+
}
281+
282+
.highlight pre {
283+
max-width: 100%;
284+
}
285+
}
286+

getting-started/using-the-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: page
3-
title: API Reference - HTML/CSS to Image
3+
title: Using the API
44
permalink: /getting-started/using-the-api/
55
parent: Getting started
66
nav_order: 1

0 commit comments

Comments
 (0)