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,009
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
  • K3Nv2 @ K3Nv2:
    I gotta raid0 these m.2s yay
  • BigOnYa @ BigOnYa:
    Do a raid10
  • K3Nv2 @ K3Nv2:
    That's tomorrow
    +1
  • Xdqwerty @ Xdqwerty:
    Yawn
  • BigOnYa @ BigOnYa:
    Damn Wal-Mart has 42" 4k TVs for only $150
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, i bet it will not fit inside your bedroom
  • BigOnYa @ BigOnYa:
    Yea here in North Korea, we are only allowed 1 19" tv per household. And the only channel we get is, MLT (Missile Launch Today)
    +1
  • K3Nv2 @ K3Nv2:
    @BigOnYa, doesn't fit in his bedroom he's American
    +1
  • BigOnYa @ BigOnYa:
    I hate ordering stuff online if I can go buy it somewhere close to me, and everywhere anymore will give you a discount only if you order it online, bs. Should be a discount if I go pick it up, not order online.
  • K3Nv2 @ K3Nv2:
    I love it for most things most stores you just shows the receipt online and they scan it
    +1
  • K3Nv2 @ K3Nv2:
    Makes it easy for incompetent restaurant staff that don't know how to hear an order
  • BigOnYa @ BigOnYa:
    Mostly for big purchases, I want it in my hands before I pay. Like a tv, I trust picking it up myself, before I'd trust it being sent thru mail/delivery. (Broken screen, etc) But yea if I can order online, then pickup at store is ok, but not all places offer that.
  • cearp @ cearp:
    > Like a tv, I trust picking it up myself, before I'd trust it being sent thru mail/delivery. (Broken screen, etc)

    Thing is, if you break it driving back to your house, it's your fault. But if the delivery driver damages it, it's not your fault.
    +1
  • K3Nv2 @ K3Nv2:
    Most people that haul big tvs have empty trucks or know enough not to set it face down
  • BigOnYa @ BigOnYa:
    Then I gotta send it back and wait another week or two. I have a pickup truck, with a extended cab, so no prob for me.
  • K3Nv2 @ K3Nv2:
    Most manufacturers pack it well enough where they aren't that dumb to let it happen
  • BigOnYa @ BigOnYa:
    They building a new Microcenter store near by me, is kinda scary. That's my favorite place, I'm like a kid in a candy store there.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, what's a microcenter?
  • K3Nv2 @ K3Nv2:
    Cool I'll make you ship me stuff
    +1
  • K3Nv2 @ K3Nv2:
    Microcenter sells high quality microwaves
  • BigOnYa @ BigOnYa:
    Computer store basically, but they sell everything, like game systems, tvs , 3d printers, etc
    +1
  • K3Nv2 @ K3Nv2:
    I've seen i9/mobo deals for like 400
  • BigOnYa @ BigOnYa:
    Yea been itching to build a new pc, mine is like 3-4 years old, ancient in pc tech time. Still using a sata SSD even.
  • K3Nv2 @ K3Nv2:
    That's still high tech to ancientboi
    K3Nv2 @ K3Nv2: That's still high tech to ancientboi