Minimal Twine Styling: An Opinionated Guide

Minimal Twine Styling

An Opinionated Guide

I’ve been working on a web page with a color/font picker and a live demo of what the text looks like, but I keep not finishing it, so I’m just going to post this text for now and I’ll come back and add a link when I finish the tool.

I’m not a typographer, or a graphic designer. In fact I think a lot of the stuff they get really het-up about is pointless navel-gazing. So take this with a grain of salt: it’s more “if you have no idea what to do, here’s one possible starting point.” I think these things are fairly easy and can help your presentation stand out.

  • Shorter lines are more comfortable to read. Aim for somewhere in the 50-75 character range.
  • Good contrast is imprtant (light/dark).
  • Fully-saturated primary colors tend to get overused, so consider changing the hue a bit and also making the color a bit less intense.

SugarCube - line length
.passage {
	/* an "ex" is supposedly the width of an 'x' character.
	 * A lot of characters are narrower, so you get more. */
	max-width: 55ex;
	/* Set the side margins to "auto" to center the block. */
	margin: 0 auto;
}
Harlowe - line length
tw-passage {
	/* an "ex" is supposedly the width of an 'x' character.
	 * But a lot of characters are narrower. */
	max-width: 55ex;
	/* Set the side margins to "auto" to center the block. */
	margin: 0 auto;
}

I think it helps to pick just two or three colors and stick to variations of those.

You want to be sure you have good contrast, so choose quite a dark color for your background and very light colors for your text (or vice versa).

Complementary colors (those directly across from each other on the color wheel) also tend to stand out against each other.

Beginners tend to pick fully saturated intense colors, so graying them out a little is a cheap trick to maybe seem like you know what you’re doing? I also tend to avoid pure colors (straight red, yellow, magenta, etc.) for this reason.

I saw an old paper once that had an idea that seemed fun to me: count a 3/4/5 triangle around the 12-element color wheel. It doesn’t really matter but I like the idea of it being slightly askew rather than directly complementary colors (straight across the color wheel) or a perfect equilateral triangle.

So find a color picker with a color wheel:

color-pickers

Pick a dark background color.

Then pick a light color for your main text by going straight across the circle and picturing it as a clock face and moving it by one hour so you have a 5/7 split. You probably don’t want your main text to be too garish, so make this closer to an off-white than a really intense color.

Then split the bigger side not quite in half again, and use that as your link color. This one should also be light but you probably want it to stand out more so make it more intense. And you might choose a dimmer value of the same color for when you hover over a link with the mouse. Harlowe also uses a different color when you’ve visited a passage, but maybe let’s keep things simple and just use the hover color for that.

SugarCube - colors
body, #ui-bar, #story, .passage {
  background: #141335;
  color: #ffe9b8;
}

a { color: #4aea75; }
a:hover { color: #36b157; }
Harlowe - colors
body, tw-story {
  background: #141335;
  color: #ffe9b8;
}

tw-link, tw-enchantment { color: #4aea75; }
tw-link:hover, tw-enchantment:hover { color: #36b157; }

tw-link.visited { color: #36b157; }
tw-link.visited:hover { color: #36b157; }

And finally, you can choose a different font if you like. Google Fonts isn’t a bad place to look. Click on a font you like, then there will be lines of text in different weights and styles, and you choose which ones you want: you probably want to select at least the normal (and italic?) 400-weight and the 700-weight bold. Then there will be a bar on the left that shows your selected families. In the “Use on the Web” section, select the @import rather than the <link> format, and paste that in at the top of your stylesheet (make sure you put the @import statement above where you try to use the font).

So your stylesheet will have something like this (note that for multi-word font names the import statement uses + symbols and the font-family style name uses spaces).

I’ve also chosen a fairly large font size to go with the shorter line lengths.

SugarCube - font
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

body, #ui-bar, #story, .passage {
  font-family: 'Libre Baskerville', serif;
  font-size: 18pt;
}
Harlowe - font
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

body, tw-story {
  font-family: 'Libre Baskerville', serif;
  font-size: 18pt;
}
8 Likes

Regarding referencing a remote stored Google Font in a project whose generated Story HTML file will be hosted on a web-server, you may want to read the following news article…

Website fined by German court for leaking visitor’s IP address via Google Fonts

…and consider such potential Privacy related issues in your project.

4 Likes

Wow, that’s interesting. I had assumed that using external resources was so ubiquitous that no-one would be able to crack down on the obvious privacy violations. That means…you’d have get permission to display ads to the user, you’d have to get permission to use external javascript libraries from a CDN, something like itch could potentially get fined for hosting all the assets on amazon cloud servers, if that’s not also where their website is hosted? This forum could get fined for allowing youtube embeds or external images… Iiinteresting.

Well. It is a little more work to download the fonts yourself, and it does mean you have to publish to a file each time you want to test, instead of just hitting the play button, but yeah. In view of that, consider using something like this google webfonts helper to download the fonts and copy/paste the stylesheet code before you publish.

2 Likes

That was the ruling of a lower German court in one case - and a number of legal experts doubt that this single ruling will stand. Those who have tried to take advantage of this ruling by sending mass cease-and-desist letters to unsuspecting website owners have already been charged by district attorneys.

However, it may still be wise to host external resources on your own server for a number of different reasons…

1 Like

I’ve always self-hosted fonts simply because Google likes to cancel projects. I can’t be coming back every five years to fix a web page just because Google changed the way they handle fonts.

4 Likes

True! I once used a Google service that gave you back a QR Code as a JPG from a simple URL request. But they stopped this service with only a 30-day notice, so I ended up having to code my own stuff anyhow in the end (but with time pressure on top).

Sorry for derailing this thread to max. off-Topic.