Skip to content

Instantly share code, notes, and snippets.

@dampatnight
Last active March 13, 2024 16:48
Show Gist options
  • Save dampatnight/56aca8711af62b0cb0183a06fd766a70 to your computer and use it in GitHub Desktop.
Save dampatnight/56aca8711af62b0cb0183a06fd766a70 to your computer and use it in GitHub Desktop.
Userscript to change column width of the Mastodon UI
// ==UserScript==
// @name Column width
// @namespace http://tampermonkey.net/
// @version 0.1
// @description https://github.com/tootsuite/mastodon/issues/8632
// @author dampatnight
// @match https://abdl.link*
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
function getWidth() {
return Math.max(
document.body.scrollWidth,
document.documentElement.scrollWidth,
document.body.offsetWidth,
document.documentElement.offsetWidth,
document.documentElement.clientWidth
);
}
GM_addStyle ( `
@media screen and (min-width: 631px) {
:not(#mastodon-timeline) > .column {
flex: 1 0 25%;
}
}
@media screen and (min-width: 631px) {
:not(#mastodon-timeline) > .media-gallery {
height: ${0.33 * getWidth()}px;
}
}
` );
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment