Skip to content

Instantly share code, notes, and snippets.

@shackra
Created August 6, 2025 08:52
Show Gist options
  • Save shackra/f66c2692cd8892c10f6ba8195765a4d7 to your computer and use it in GitHub Desktop.
Save shackra/f66c2692cd8892c10f6ba8195765a4d7 to your computer and use it in GitHub Desktop.
GNU Mail Archive - Dark Theme
// ==UserScript==
// @name Mail Archive - Dark Theme
// @namespace https://chat.openai.com/
// @version 1.1
// @description Dark mode + better navigation for list.nongnu.org (MHonArc archives)
// @match https://lists.nongnu.org/archive/html/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
const style = document.createElement("style");
style.textContent = `
body {
font-family: system-ui, sans-serif;
background-color: #121212;
color: #e0e0e0;
line-height: 1.6;
margin: 0;
padding: 0 1em;
}
a {
color: #80cbc4;
text-decoration: none;
}
a:hover {
color: #b2dfdb;
text-decoration: underline;
}
h2 {
margin-top: 1.5em;
font-size: 1.5em;
color: #ffffff;
}
hr {
border: none;
border-top: 1px solid #444;
margin: 2em 0;
}
pre {
background: #1e1e1e;
border: 1px solid #333;
padding: 1em;
overflow-x: auto;
font-family: ui-monospace, SFMono-Regular, monospace;
font-size: 0.95em;
color: #cfd8dc;
}
table {
border-collapse: collapse;
margin: 1em 0;
}
td {
padding: 4px 8px;
}
/* Navigation buttons */
.top-nav {
display: flex;
flex-wrap: wrap;
gap: 0.5em;
justify-content: center;
margin-top: 1em;
margin-bottom: 1em;
}
.top-nav a {
display: inline-block;
background: #1f1f1f;
padding: 6px 12px;
border-radius: 4px;
border: 1px solid #333;
font-size: 0.9em;
}
.top-nav a:hover {
background: #333;
}
/* Hide unwanted elements */
center, table[bgcolor="#000000"], table[bgcolor="#FFFFCC"],
.nowrap, form[action="/archive/cgi-bin/namazu.cgi"],
form[action="/mp/yyz.py"] {
display: none !important;
}
ul {
padding-left: 1.2em;
}
/* Content layout */
body > :not(script):not(style) {
max-width: 800px;
margin-left: auto;
margin-right: auto;
}
/* Footer & metadata */
.footer {
margin-top: 2em;
font-size: 0.85em;
color: #888;
}
`;
document.head.appendChild(style);
// Mejorar los enlaces de navegación arriba del título
const pni = document.querySelector('body hr + a')?.parentNode;
if (pni && pni.nodeName === 'P') {
const navLinks = Array.from(pni.querySelectorAll('a'));
const container = document.createElement('div');
container.className = 'top-nav';
navLinks.forEach(link => {
const a = document.createElement('a');
a.href = link.href;
a.textContent = link.textContent;
container.appendChild(a);
});
pni.replaceWith(container);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment