Skip to content

Commit e3b5527

Browse files
authored
fix(css): auto sizing code blocks on ios (#1094)
2 parents d161617 + 0dd1398 commit e3b5527

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

src/css/custom.css

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@
99
font-display: swap;
1010
}
1111

12-
/* Fix iOS auto-sizing on mobile */
13-
html {
14-
-webkit-text-size-adjust: 100%;
15-
text-size-adjust: 100%;
16-
}
17-
pre,
18-
code {
19-
-webkit-text-size-adjust: 100%;
20-
text-size-adjust: 100%;
21-
}
22-
2312
/* ============================================================
2413
Tokens (Light)
2514
============================================================ */
@@ -38,7 +27,6 @@ code {
3827
--ifm-font-family-heading: "Satoshi";
3928
--ifm-heading-font-weight: 450;
4029
--ifm-font-weight-bold: 580;
41-
--ifm-font-size-base: 16px;
4230
--ifm-code-font-size: 85%;
4331

4432
/* Shape */
@@ -512,3 +500,22 @@ div[class^="searchBar_"] div[class*="hitFooter"] a:hover {
512500
padding: 6px 10px;
513501
}
514502
}
503+
504+
/* Fix iOS auto-sizing code blocks on mobile */
505+
@supports (-webkit-touch-callout: none) {
506+
@media (max-width: 600px) {
507+
.theme-code-block pre.prism-code {
508+
white-space: pre-wrap !important;
509+
overflow-wrap: anywhere !important;
510+
word-break: break-word !important;
511+
overflow-x: auto !important;
512+
font-size: 0.85em !important;
513+
line-height: 1.45 !important;
514+
}
515+
516+
.theme-code-block pre.prism-code > code,
517+
.theme-code-block pre.prism-code .token-line {
518+
white-space: inherit !important;
519+
}
520+
}
521+
}

0 commit comments

Comments
 (0)