Failed attempt to increase api docs font size on mobile

This commit is contained in:
MartinBraquet
2025-12-15 18:39:31 +02:00
parent 04e2376829
commit 3e06b61eba
2 changed files with 16 additions and 5 deletions

View File

@@ -518,6 +518,12 @@ app.get(
swaggerUi.setup(swaggerDocument, {
customSiteTitle: 'Compass API Docs',
customCssUrl: '/swagger.css',
customJs: `
const meta = document.createElement('meta');
meta.name = 'viewport';
meta.content = 'width=device-width, initial-scale=1';
document.head.appendChild(meta);
`,
}),
)
app.use(rootPath, swaggerUi.serve)

View File

@@ -65,13 +65,20 @@
}
/* Increase font sizes on mobile for better readability */
/* Still not working though */
@media (max-width: 640px) {
html,
body,
.swagger-ui {
font-size: 16px !important;
font-size: 32px !important;
line-height: 1.5 !important;
}
.swagger-ui {
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
}
/* Common text elements */
.swagger-ui p,
.swagger-ui label,
@@ -85,11 +92,9 @@
.swagger-ui table tbody tr td,
.swagger-ui .tab li,
.swagger-ui .response-col_links,
.swagger-ui .opblock-summary-path,
.swagger-ui .opblock-summary-description {
font-size: 16px !important;
}
.swagger-ui .opblock-summary-path {
font-size: 20px !important;
font-size: 32px !important;
}
/* Headings scale */