Skip to content

Commit

Permalink
Add overflow-x: auto to tables
Browse files Browse the repository at this point in the history
  • Loading branch information
w4 committed Jan 21, 2024
1 parent a254a4a commit 235951b
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 1 deletion.
15 changes: 15 additions & 0 deletions statics/sass/tables.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
@import 'colours';

.table-responsive {
display: block;
width: 100%;
overflow-x: auto;
}

table {
@media (prefers-color-scheme: dark) {
color: darken($darkModeHighlightColour, 20%);
}

border-collapse: collapse;

th, td {
white-space: nowrap;
padding-right: 10px;

&:last-of-type {
padding-right: 0;
}
}

th {
text-align: left;
}
Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>{% block title %}rgit{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="/style-{{ crate::GLOBAL_CSS_HASH.as_ref() }}.css" />
{%- block head -%}{%- endblock %}
Expand Down
2 changes: 2 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "base.html" %}

{% block content %}
<div class="table-responsive">
<table class="repositories">
<thead>
<tr>
Expand Down Expand Up @@ -53,4 +54,5 @@
{%- endfor %}
</tbody>
</table>
</div>
{% endblock %}
2 changes: 2 additions & 0 deletions templates/repo/commit.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{% block commit_nav_class %}active{% endblock %}

{% block content %}
<div class="table-responsive">
<table class="commit-info">
<tbody>
<tr>
Expand Down Expand Up @@ -41,6 +42,7 @@
</tr>
</tbody>
</table>
</div>

<h2>{{ commit.summary() }}</h2>
<pre>{{ commit.body() }}</pre>
Expand Down
2 changes: 2 additions & 0 deletions templates/repo/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
{% block log_nav_class %}active{% endblock %}

{% block content %}
<div class="table-responsive">
<table class="repositories">
{% call refs::commit_table(commits) %}
</table>
</div>

{% if let Some(next_offset) = next_offset %}
<div class="mt-2 text-center">
Expand Down
2 changes: 2 additions & 0 deletions templates/repo/refs.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% block refs_nav_class %}active{% endblock %}

{% block content %}
<div class="table-responsive">
<table class="repositories">
{% call refs::branch_table(refs.heads) %}

Expand All @@ -20,4 +21,5 @@
{%- call refs::tag_table(refs.tags) -%}
{%- endif %}
</table>
</div>
{% endblock %}
2 changes: 2 additions & 0 deletions templates/repo/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% block summary_nav_class %}active{% endblock %}

{% block content %}
<div class="table-responsive">
<table class="repositories">
{% call refs::branch_table(refs.heads.iter().take(10)) %}
{%- if refs.heads.len() > 10 -%}
Expand Down Expand Up @@ -61,4 +62,5 @@
</tbody>
{%- endif %}
</table>
</div>
{% endblock %}
2 changes: 2 additions & 0 deletions templates/repo/tag.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% extends "repo/base.html" %}

{% block content %}
<div class="table-responsive">
<table class="commit-info">
<tbody>
<tr>
Expand Down Expand Up @@ -37,6 +38,7 @@
</tr>
</tbody>
</table>
</div>

<pre class="h2-first-line">{{ tag.message }}</pre>
{% endblock %}
2 changes: 2 additions & 0 deletions templates/repo/tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% block tree_nav_class %}active{% endblock %}

{% block content %}
<div class="table-responsive">
<table class="repositories">
<thead>
<tr>
Expand Down Expand Up @@ -32,4 +33,5 @@
{% endfor -%}
</tbody>
</table>
</div>
{% endblock %}

0 comments on commit 235951b

Please sign in to comment.