Skip to content

Instantly share code, notes, and snippets.

@MilesCranmer
Last active July 2, 2026 07:35
Show Gist options
  • Select an option

  • Save MilesCranmer/56a80c52408b782f75e2854331c0cfa6 to your computer and use it in GitHub Desktop.

Select an option

Save MilesCranmer/56a80c52408b782f75e2854331c0cfa6 to your computer and use it in GitHub Desktop.
Userscript to restore the red arXiv header. Install with Tampermonkey: https://www.tampermonkey.net/.
// ==UserScript==
// @name arXiv red header
// @namespace https://arxiv.org/
// @version 1.2
// @description Revert the June 2026 black arXiv header to the classic red (#b31b1b) with the old white logo
// @match https://arxiv.org/*
// @match https://*.arxiv.org/*
// @run-at document-start
// @grant GM_addStyle
// ==/UserScript==
(function () {
"use strict";
const css = `
.ds-site-header {
background: #b31b1b !important;
}
.ds-site-header-nav a,
.ds-site-header-nav a:visited,
.ds-site-header-nav button,
.ds-site-header-nav-toggle {
color: #f2d5d5 !important;
}
.ds-site-header-nav a:hover,
.ds-site-header-nav button:hover,
.ds-site-header-nav-toggle:hover {
background: #8f1414 !important;
color: #ffffff !important;
}
.ds-site-header-login {
color: #ffffff !important;
}
.ds-site-header-divider {
background: rgba(255, 255, 255, 0.35) !important;
}
@media (max-width: 599px) {
.ds-site-header.is-collapsible .ds-site-header-nav {
background: #b31b1b !important;
border-top-color: rgba(255, 255, 255, 0.3) !important;
}
.ds-site-header.is-collapsible .ds-site-header-nav a,
.ds-site-header.is-collapsible .ds-site-header-nav button {
border-bottom-color: rgba(255, 255, 255, 0.25) !important;
}
}
`;
if (typeof GM_addStyle === "function") {
GM_addStyle(css);
} else {
const style = document.createElement("style");
style.textContent = css;
(document.head || document.documentElement).appendChild(style);
}
const whiteLogo = "https://arxiv.org/static/browse/0.3.4/images/arxiv-logo-one-color-white.svg";
function swapLogo() {
document.querySelectorAll(".ds-site-header-logo img").forEach((img) => {
img.src = whiteLogo;
img.removeAttribute("srcset");
});
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", swapLogo);
} else {
swapLogo();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment