patx/gitman

help mobile styling a little

Commit a03effa · patx · 2026-05-10T20:13:42Z

Changeset
a03effacc83fc28f9eb180ec019a80d84cb59c63
Parents
01f59f993640ac3621c8b7b8a3d593a61e2b1e0a

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/static/styles.css b/static/styles.css
index a57fb47..ad3ee96 100644
--- a/static/styles.css
+++ b/static/styles.css
@@ -1,6 +1,11 @@
 * { box-sizing: border-box; }
 [hidden] { display: none !important; }
 
+html {
+  -webkit-text-size-adjust: 100%;
+  text-size-adjust: 100%;
+}
+
 :root {
   color-scheme: light;
   --page-bg: #fff;
@@ -310,6 +315,15 @@ button, .button {
 .activity-detail { color: var(--detail); }
 .comment-list { display: grid; gap: 1rem; }
 .comment { border-bottom: 1px solid var(--soft-border); }
+.comment, .activity-feed li { min-width: 0; }
+.comment p, .activity-title, .activity-detail {
+  font-size: 1rem;
+  line-height: 1.6;
+  overflow-wrap: anywhere;
+}
+.comment small, .activity-feed .muted {
+  font-size: .875rem;
+}
 .diff { max-height: 70vh; }
 .file-table { width: 100%; border-collapse: collapse; }
 .file-table td { padding: .4rem 0; border-bottom: 1px solid var(--soft-border); }
diff --git a/templates/base.tpl b/templates/base.tpl
index 3bedc11..a58f2f5 100644
--- a/templates/base.tpl
+++ b/templates/base.tpl
@@ -9,7 +9,7 @@
 <link rel="apple-touch-icon" sizes="180x180" href="/static/git.svg">
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css">
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" media="(prefers-color-scheme: dark)">
-  <link rel="stylesheet" href="/static/styles.css?v=2">
+  <link rel="stylesheet" href="/static/styles.css?v=3">
 </head>
 <body>
   <header class="site-header">
diff --git a/tests/test_app.py b/tests/test_app.py
index 17c8a12..e8864d1 100644
--- a/tests/test_app.py
+++ b/tests/test_app.py
@@ -517,6 +517,15 @@ def test_styles_support_system_dark_mode(isolated_app):
     assert 'media="(prefers-color-scheme: dark)"' in response.text
 
 
+def test_styles_keep_comment_and_activity_text_readable_on_mobile(isolated_app):
+    css = (REPO_ROOT_FOR_IMPORTS / "static" / "styles.css").read_text(encoding="utf-8")
+
+    assert "-webkit-text-size-adjust: 100%" in css
+    assert "text-size-adjust: 100%" in css
+    assert ".comment p, .activity-title, .activity-detail" in css
+    assert "overflow-wrap: anywhere" in css
+
+
 def test_index_public_repo_search_finds_repositories_by_fuzzy_name(isolated_app):
     owner = create_user("alice")
     other = create_user("bob")