Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pico-api-docs",
"version": "1.5.0",
"version": "mobile-overflow-scrollable",
"description": "PICO SulTeng API Documentation - COVID-19 Sulawesi Tengah Data API",
"main": "index.js",
"scripts": {
Expand Down
15 changes: 12 additions & 3 deletions src/components/CodeBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@ onMounted(() => {

<style scoped>
.code-block-wrapper {
@apply rounded-lg overflow-hidden my-4 transition-colors duration-200;
@apply rounded-lg my-4 transition-colors duration-200;
@apply border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900;
overflow: hidden; /* keep border-radius clipping */
max-width: 100%;
}

.code-block-wrapper.dark-theme {
Expand Down Expand Up @@ -319,8 +321,11 @@ onMounted(() => {
}

.code-container {
@apply relative overflow-x-auto;
@apply bg-white dark:bg-gray-900;
@apply relative bg-white dark:bg-gray-900;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
max-width: 100%;
}

.dark-theme .code-container {
Expand All @@ -331,6 +336,10 @@ onMounted(() => {
@apply m-0 p-4 text-xs sm:text-sm font-mono leading-relaxed;
background: transparent !important;
font-family: 'Fira Code', 'JetBrains Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
white-space: pre;
word-break: normal;
word-wrap: normal;
min-width: min-content;
}

.code-container code {
Expand Down
18 changes: 18 additions & 0 deletions src/components/MathFormula.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,23 @@ const renderedMath = computed(() => {
.katex-formula {
display: block;
text-align: center;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
max-width: 100%;
padding-bottom: 4px; /* space for scrollbar */
}

/* Ensure KaTeX inner elements don't force overflow */
.katex-formula :deep(.katex-display) {
overflow-x: auto;
overflow-y: hidden;
max-width: 100%;
margin: 0.5em 0;
}

.katex-formula :deep(.katex-html) {
overflow-x: auto;
max-width: 100%;
}
</style>
32 changes: 32 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,38 @@ body {
* { animation: none !important; transition-duration: 0.01ms !important; }
}

/* Mobile overflow fixes */
@media (max-width: 768px) {
/* Ensure code blocks are scrollable on mobile */
.code-block-wrapper,
.code-container,
.code-panel,
.code-panel pre {
overflow-x: auto !important;
-webkit-overflow-scrolling: touch;
max-width: 100%;
}

/* Ensure params table is scrollable */
.params-table {
display: block;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
white-space: nowrap;
}

.params-table td,
.params-table th {
white-space: normal;
min-width: 80px;
}

.params-table td:last-child {
min-width: 150px;
white-space: normal;
}
}

/* Dark mode code syntax colors */
.token-string { color: #a3e4c9; }
.token-number { color: #f97316; }
Expand Down
Loading