Hacking Userscript to increase the font size of text in postings in the new theme

notimp

Well-Known Member
OP
Member
Joined
Sep 18, 2007
Messages
5,779
Trophies
1
XP
4,420
Country
Laos
The following can be used in Greasemonkey, Tampermonkey, or Violentmonkey (tested with Tampermonkey) to increase the posting font size.

The new fontsize is just a little too small (at least in the new theme (might be kerning, whitespace or colors)), and the one one step larger in forum settings is a little too large for my liking.. :)

Code:
// ==UserScript==
// @name gbatemp increase font size
// @namespace http://userstyles.org
// @include https://*.gbatemp.net/threads*
// @include https://gbatemp.net/threads*
// @run-at document-start
// @version 0.1
// ==/UserScript==
(function() {var css = [
"@namespace url(http://www.w3.org/1999/xhtml);",
"body {font-size: 1.38em !important; line-height: 1.5em !important;}",
" .bbCodeBlock-content {font-size: 0.97em !important;}",
" .fr-element {font-size: 1em !important;}"
].join("\n");
if (typeof GM_addStyle != "undefined") {
GM_addStyle(css);
} else {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
heads[0].appendChild(node);
} else {
// no head yet, stick it whereever
document.documentElement.appendChild(node);
}
}
})();

edit: Also increased the quote box font size.
edit2: Added modified line-height.
edit3: Added font size increase for the reply box as well.
 
Last edited by notimp,

notimp

Well-Known Member
OP
Member
Joined
Sep 18, 2007
Messages
5,779
Trophies
1
XP
4,420
Country
Laos
The site has built-in font scaling settings in your preferences.
Yes, and it is too small on the default, and too large on the next larger step in the scaling settings.

So what do you do? You script. Well, I script. :)

Script is meant to be used with the default font scaling option in the account preferences.

Creating ebooks for close to ten years now has taught me a thing or two about reading flow. And if I choose the font size, one step larger than default in the account settings, I get too few letters per line in the new design. Which makes reading large amounts of text a flipping pain.

Also the default font size is _very_ small on screens with decent ppi (Macbooks, f.e.).

That said, I have no comparison, if it has changed from the old design, I just noticed, that readability suffered quite a bit, and then started scripting so the forum actually became usable for me again.

(Had that script going for another site already, and only modified it for it to change font sizes on gbatemp.)
 
Last edited by notimp,

notimp

Well-Known Member
OP
Member
Joined
Sep 18, 2007
Messages
5,779
Trophies
1
XP
4,420
Country
Laos
Does that really need to be a script? Can't you just make a userstyle?
Probably would work as a userstyle as well. I dont have Stylish installed as an addon on my current browser - so this was the way I chose to go with. :)

The only elements it changes are:

Code:
body {font-size: 1.38em !important; line-height: 1.5em !important;}
.bbCodeBlock-content {font-size: 0.97em !important;}
.fr-element {font-size: 1em !important;}

on urls that start with
https://*.gbatemp.net/threads*
or
https://gbatemp.net/threads*

(* = wildcard for "anything")
 
  • Like
Reactions: Seriel

Seriel

Doing her best
Member
Joined
Aug 18, 2015
Messages
3,298
Trophies
3
Age
24
Location
UK
XP
6,041
Country
United Kingdom
Probably would work as a userstyle as well. I dont have Stylish installed as an addon on my current browser - so this was the way I chose to go with. :)

The only elements it changes are:

Code:
body {font-size: 1.38em !important; line-height: 1.5em !important;}
.bbCodeBlock-content {font-size: 0.97em !important;}
.fr-element {font-size: 1em !important;}

on urls that start with
https://*.gbatemp.net/threads*
or
https://gbatemp.net/threads*

(* = wildcard for "anything")
Understood, thank you for clarifying 🙂
 

notimp

Well-Known Member
OP
Member
Joined
Sep 18, 2007
Messages
5,779
Trophies
1
XP
4,420
Country
Laos
Does that really need to be a script? Can't you just make a userstyle?
Checked the modifications with the Stylus chrome extension, code would have to be a little different:

Code:
body{
   font-size: 1.38em !important; line-height: 1.5em !important;
}

.bbCodeBlock-content{
    font-size: 0.97em !important; line-height: 1.5em !important;
}

.fr-element{
    font-size: 1em !important;
}

and

active for urls that fit the following regular expression:
Code:
https?:\/\/(www\.){0,1}gbatemp\.net\/threads\/?.*


edit: fixed font-size for the quote block. 0.97em for some reason is the equivalent to 1em in the Tampermonkey script.
 
Last edited by notimp,
  • Like
Reactions: Seriel

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Xdqwerty @ Xdqwerty:
    @Psionic Roshambo, why are most new south park episodes half hour specials?
    +1
  • K3Nv2 @ K3Nv2:
    @Psionic Roshambo, let me get a Netflix account I've always been nice to you
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I made a honey pepper glazed turkey breast for dinner turned out pretty bomb
  • K3Nv2 @ K3Nv2:
    We can Netflix and chill
  • Xdqwerty @ Xdqwerty:
    Nvm not half hour, but hour long
  • Xdqwerty @ Xdqwerty:
    Normal south park episodes are already half hour
  • Psionic Roshambo @ Psionic Roshambo:
    Got 2 free Xumo boxes they work pretty good
  • K3Nv2 @ K3Nv2:
    I'm happy to get anything most series don't make it pass 6 seasons
  • Psionic Roshambo @ Psionic Roshambo:
    Except Stars and Encore those are being a bitch lol
  • K3Nv2 @ K3Nv2:
    I may consider that onn pro box finally a media box with type A ;O
    +1
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, cuz the companies don't want em to
  • K3Nv2 @ K3Nv2:
    No it's revenue and demand south park could argue has a bigger audience than family guy about the same
    +1
  • K3Nv2 @ K3Nv2:
    Family guy is worth 300mill south parks worth 1Bill according to the interwebs
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, probably cuz family guy is more disliked compared to south park
  • K3Nv2 @ K3Nv2:
    It just does the same formula south park can press buttons without going overboard
  • Xdqwerty @ Xdqwerty:
    And bc most of the family guy budget is spent on the voice actors rather than on the animation
  • K3Nv2 @ K3Nv2:
    Southpark could spend 30k on a animated dick and people would laugh at it
    +2
  • K3Nv2 @ K3Nv2:
    lol one prescription to Lizzo
  • Xdqwerty @ Xdqwerty:
    who is lizzo?
  • Xdqwerty @ Xdqwerty:
    yawn
  • BakerMan @ BakerMan:
    guys, doge is dead
  • BakerMan @ BakerMan:
    let's get some o7s for that legendary dog

    o7
  • Xdqwerty @ Xdqwerty:
    i think its raining
    Xdqwerty @ Xdqwerty: i think its raining