Mark Backlog Document Headings

Adds heading-level markers before each heading in Backlog documents to improve their visibility.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Advertisement:

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

Advertisement:

// ==UserScript==
// @name            Mark Backlog Document Headings
// @name:ja         Backlog ドキュメントの見出しにマーカーをつける
// @namespace       https://github.com/simochee/userscripts
// @version         2026.07.02.1
// @description     Adds heading-level markers before each heading in Backlog documents to improve their visibility.
// @description:ja  Backlog のドキュメントの各見出しの前に見出しレベルのマーカーをつけて視認性を上げます。
// @license         MIT
// @icon            https://www.google.com/s2/favicons?sz=64&domain=backlog.jp
// @match           https://*.backlog.com/*
// @match           https://*.backlog.jp/*
// @match           https://*.backlogtool.com/*
// @grant           GM_addStyle
// ==/UserScript==

(function() {
	"use strict";
	var s = new Set();
	var _css = async (t) => {
		if (s.has(t)) return;
		s.add(t);
		((c) => {
			if (typeof GM_addStyle === "function") GM_addStyle(c);
			else (document.head || document.documentElement).appendChild(document.createElement("style")).append(c);
		})(t);
	};
	_css("@import \"https://fonts.googleapis.com/css2?family=Pathway+Gothic+One&text=%23&display=swap\";\n\n.doc-container :where(h1, h2, h3, h4, h5, h6) {\n  position: relative;\n}\n\n.doc-container :where(h1, h2, h3, h4, h5, h6):before {\n  color: var(--textColorWeak);\n  font-family: Pathway Gothic One, sans-serif;\n  position: absolute;\n  top: 50%;\n  left: 0;\n  transform: translateX(calc(-100% - 8px)) translateY(-50%);\n}\n\n.main-container:where(.-medium, .-small) :where(h1, h2, h3, h4, h5, h6):before {\n  left: 5px;\n}\n");
	var markers = Array.from({ length: 6 }, (_, i) => i + 1).map((lv) => `
	.doc-container h${lv}::before {
		content: "${"#".repeat(lv)}";
	}
`).join("\n");
	GM_addStyle(markers);
})();