Skip to content

Instantly share code, notes, and snippets.

@ivellios
Last active January 19, 2024 17:56
Show Gist options
  • Save ivellios/9f37084822ec74710a3d2597f924893a to your computer and use it in GitHub Desktop.
Save ivellios/9f37084822ec74710a3d2597f924893a to your computer and use it in GitHub Desktop.
Tampermonkey script for narrowing the content for easier reading
// ==UserScript==
// @name D&D Beyond - content narrow column styling
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Displays contents of D&D Beyond books in a narrow column for easier reading. Keeps tables and images as they were.
// @author Ivellios
// @installURL https://gist.githubusercontent.com/ivellios/9f37084822ec74710a3d2597f924893a/raw/dndbeyond_narrow.js
// @downloadURL https://gist.githubusercontent.com/ivellios/9f37084822ec74710a3d2597f924893a/raw/dndbeyond_narrow.js
// @updateURL https://gist.githubusercontent.com/ivellios/9f37084822ec74710a3d2597f924893a/raw/dndbeyond_narrow.js
// @match https://www.dndbeyond.com/sources/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=dndbeyond.com
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
GM_addStyle(
`.p-article-content > p,
.p-article-content > ul,
.p-article-content > ol,
.p-article-content > aside,
.p-article-content > blockquote {
max-width: 400px;
}
.p-article-content > p:has(img) {
max-width: 100%;
}
.p-article-content .compendium-image-left {
float: right !important
}
`);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment