Skip to content

Commit

Permalink
layout: wrap tables in divs to allow horizontal scrolling.
Browse files Browse the repository at this point in the history
Some minor style improvements, slightly smaller font, address
scrolling issues on mobile, and reduce font size.
  • Loading branch information
jessicah committed Aug 29, 2024
1 parent c811a12 commit 89b1d3d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
10 changes: 10 additions & 0 deletions extensions/abigroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ def visit_highlight(self, node):
def depart_highlight(self, node):
self.body.append('</span>')

# add a wrapper around tables, so that horizontal
# scrolling is possible (useful on mobile)
def visit_table(self, node):
self.body.append('<div class="table">')
super().visit_table(node)

def depart_table(self, node):
super().depart_table(node)
self.body.append('</div>')

class highlight(Inline, TextElement): pass

class highlightMethod(highlight):
Expand Down
15 changes: 14 additions & 1 deletion theme/haikumodern/static/haikumodern.css.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ body {
min-width: {{ theme_body_min_width|todim }};
max-width: {{ theme_body_max_width|todim }};
color: {{ theme_textcolor }};

/* seems to address weird scrolling behaviour on mobile */
position: fixed;
}

/* link colors and text decoration */
Expand Down Expand Up @@ -101,14 +104,17 @@ a.uplink {

display: grid;

grid-template-columns: 1fr min-content minmax(0, 100ch) 1fr;
grid-template-columns: 1fr min-content minmax(0, 100ch) 2fr;
/* header; nav; main; footer */
grid-template-rows: 85px 20px 1fr auto;
grid-template-areas:
'header header header header'
'topnav topnav topnav topnav'
'. toc main main'
'footer footer footer footer';

/* this shouldn't be needed, but having weird issues... */
overflow: clip;
}

header {
Expand Down Expand Up @@ -226,6 +232,8 @@ main {
margin: 0;
padding-left: 1em;
padding-right: 1em;

font-size: 90%;
}

main > * {
Expand Down Expand Up @@ -297,6 +305,11 @@ table.index a:hover, table.index a:active {
color: {{ theme_hoverlinkcolor }};
}

/* wraps table elements to support horizontal
scrolling on mobile... */
div.table {
overflow-x: auto;
}

/* Haiku User Guide styles and layout */

Expand Down

0 comments on commit 89b1d3d

Please sign in to comment.