Last active
March 13, 2024 16:48
-
-
Save dampatnight/56aca8711af62b0cb0183a06fd766a70 to your computer and use it in GitHub Desktop.
Userscript to change column width of the Mastodon UI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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