Skip to content

Commit

Permalink
Make darkfish more responsive and readable on mobile devices
Browse files Browse the repository at this point in the history
- Make the sidebar toggle fixed on all devices
- Prevent default zooming on mobile devices
- Improve sidebar opening on mobile devices
  • Loading branch information
st0012 committed Aug 25, 2024
1 parent 95cc15b commit 692efe3
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion lib/rdoc/generator/template/darkfish/css/rdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ nav a:hover {
#navigation-toggle {
z-index: 1000;
font-size: 2em;
position: absolute;
display: block;
position: fixed;
}

#navigation-toggle[aria-expanded="true"] {
Expand Down Expand Up @@ -265,6 +266,7 @@ main {
font-size: 16px;
line-height: 1.6;
color: var(--text-color);
box-sizing: border-box;
}

@media (min-width: 1024px) {
Expand Down Expand Up @@ -715,4 +717,35 @@ main .attribute-access-type {
font-family: var(--font-code);
}

@media (max-width: 480px) {
nav {
width: 100%;
}

main {
margin: 1em auto;
padding: 0 1em;
max-width: 100%;
}

#navigation-toggle {
top: 10px;
right: 10px;
}

#navigation-toggle[aria-expanded="true"] {
left: auto;
}

#navigation-toggle[aria-expanded="false"] {
left: auto;
}

table {
display: block;
overflow-x: auto;
white-space: nowrap;
}
}
/* @end */

0 comments on commit 692efe3

Please sign in to comment.