Commit 79d33c0

Daniel Axtens <dja@axtens.net>
2026-10-19 08:42:11
remove hidden goto-top button with inline JavaScript
the go to top button is always hidden but still throws errors if run with a strict CSP. Simply delete it entirely. If we need one in future we can re-add one that jumps to an anchor rather than scrolling with javascript.
1 parent 55f7708
Changed files (3)
assets/layout.css
@@ -217,23 +217,6 @@ header .path {
     word-break: break-all;
 }
 
-.goto-top {
-    display: none;
-    margin-left: auto;
-    padding: 6px 10px;
-    background: none;
-    border: none;
-    border-radius: 6px;
-    gap: 4px;
-    align-items: center;
-    color: var(--c-text-1);
-    cursor: pointer;
-}
-
-.goto-top:hover {
-    background: var(--c-bg-elv);
-}
-
 .raw-actions {
     display: flex;
     margin-left: auto;
pkg/templates/commit.gohtml
@@ -75,12 +75,6 @@
                             {{ else }}
                                 <div class="path">{{ .Path }}</div>
                             {{ end }}
-                            <button class="goto-top" onclick="window.scrollTo({top: 0, behavior: 'smooth'})">
-                                <svg aria-hidden="true" focusable="false" width="16" height="16">
-                                    <use xlink:href="#arrow-top"></use>
-                                </svg>
-                                Top
-                            </button>
                         </header>
                     </div>
                     {{ if .IsBinary }}
pkg/templates/header.gohtml
@@ -34,12 +34,6 @@
                     </a>
                 </div>
             {{ end }}
-            <button class="goto-top" onclick="window.scrollTo({top: 0, behavior: 'smooth'})">
-                <svg aria-hidden="true" focusable="false" width="16" height="16">
-                    <use xlink:href="#arrow-top"></use>
-                </svg>
-                Top
-            </button>
         </header>
     </div>
 {{ end }}