Skip to content

Commit d7f6e3a

Browse files
committed
Make darkfish more responsive and readable on mobile devices
- Make the sidebar toggle fixed on all devices - Prevent default zooming on mobile devices - Improve sidebar opening on mobile devices
1 parent 6cde9ed commit d7f6e3a

File tree

1 file changed

+49
-1
lines changed
  • lib/rdoc/generator/template/darkfish/css

1 file changed

+49
-1
lines changed

lib/rdoc/generator/template/darkfish/css/rdoc.css

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ nav a:hover {
219219
#navigation-toggle {
220220
z-index: 1000;
221221
font-size: 2em;
222-
position: absolute;
222+
display: block;
223+
position: fixed;
223224
}
224225

225226
#navigation-toggle[aria-expanded="true"] {
@@ -264,6 +265,7 @@ main {
264265
font-size: 16px;
265266
line-height: 1.6;
266267
color: var(--text-color);
268+
box-sizing: border-box;
267269
}
268270

269271
@media (min-width: 1024px) {
@@ -714,4 +716,50 @@ main .attribute-access-type {
714716
font-family: var(--font-code);
715717
}
716718

719+
@media (max-width: 1023px) {
720+
body {
721+
font-size: 14px;
722+
}
723+
724+
nav {
725+
width: 100%;
726+
}
727+
728+
main {
729+
margin: 1em auto;
730+
padding: 0 1em;
731+
max-width: 100%;
732+
}
733+
734+
#navigation-toggle {
735+
top: 10px;
736+
right: 10px;
737+
z-index: 1001;
738+
}
739+
740+
#navigation-toggle[aria-expanded="true"] {
741+
left: auto;
742+
}
743+
744+
#navigation-toggle[aria-expanded="false"] {
745+
left: auto;
746+
}
747+
748+
#search-field {
749+
font-size: 16px; /* Prevents zoom on focus in iOS */
750+
}
751+
}
752+
753+
@media (max-width: 480px) {
754+
pre, code {
755+
font-size: 14px;
756+
}
757+
758+
table {
759+
display: block;
760+
overflow-x: auto;
761+
white-space: nowrap;
762+
}
763+
}
717764
/* @end */
765+

0 commit comments

Comments
 (0)