Skip to content

Commit 3e06b61

Browse files
committed
Failed attempt to increase api docs font size on mobile
1 parent 04e2376 commit 3e06b61

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

backend/api/src/app.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,12 @@ app.get(
518518
swaggerUi.setup(swaggerDocument, {
519519
customSiteTitle: 'Compass API Docs',
520520
customCssUrl: '/swagger.css',
521+
customJs: `
522+
const meta = document.createElement('meta');
523+
meta.name = 'viewport';
524+
meta.content = 'width=device-width, initial-scale=1';
525+
document.head.appendChild(meta);
526+
`,
521527
}),
522528
)
523529
app.use(rootPath, swaggerUi.serve)

backend/api/src/public/swagger.css

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,20 @@
6565
}
6666

6767
/* Increase font sizes on mobile for better readability */
68+
/* Still not working though */
6869
@media (max-width: 640px) {
70+
html,
6971
body,
7072
.swagger-ui {
71-
font-size: 16px !important;
73+
font-size: 32px !important;
7274
line-height: 1.5 !important;
7375
}
7476

77+
.swagger-ui {
78+
-webkit-text-size-adjust: 100%;
79+
text-size-adjust: 100%;
80+
}
81+
7582
/* Common text elements */
7683
.swagger-ui p,
7784
.swagger-ui label,
@@ -85,11 +92,9 @@
8592
.swagger-ui table tbody tr td,
8693
.swagger-ui .tab li,
8794
.swagger-ui .response-col_links,
95+
.swagger-ui .opblock-summary-path,
8896
.swagger-ui .opblock-summary-description {
89-
font-size: 16px !important;
90-
}
91-
.swagger-ui .opblock-summary-path {
92-
font-size: 20px !important;
97+
font-size: 32px !important;
9398
}
9499

95100
/* Headings scale */

0 commit comments

Comments
 (0)