Let me begin by saying that I think I’m a bit more comfortable reaching for I6 code than most Inform authors, so I’m going to start by addressing the question in I6, and then consider the question in Inform 7 code.
Fundamentally, Inform Glulx games can do anything Glk allows, and they are also confined by what Glk allows. Here’s the Glk specification.
Glk defines a bunch of functions that you can call from I6 code (which you can write in an Inform extension); those functions do a bunch of things. Some of those functions, by design, are not available in all interpreters, so you’re supposed to check if they’re “available” before you use them, using a Glk “gestalt.” For example, Basic Hyperlinks has code like this:
To say set link (N - a number):
(- if (glk_gestalt(gestalt_Hyperlinks, 0)) glk_set_hyperlink({N}); -)
To say end link:
(- if (glk_gestalt(gestalt_Hyperlinks, 0)) glk_set_hyperlink(0); -)
That stuff in the parentheses is I6 code, directly calling Glk functions defined in the spec. glk_set_hyperlink() is defined in Section 9.1.
glk_gestalt() is defined in Section 1.7. Each gestalt has a code number, which is some number that authors and interpreters all agree on in advance. glk_gestalt() allows the interpreter to say “I do/don’t support hyperlinks.”
The code above lets users of Basic Hyperlinks (Inform authors) write code like this:
Mossy Bank is a room. "The shore here is made up of round rocks,
very heavily grown over with a slippery grey-green moss. To the
[set link 1]north[end link] is a small shack."
Fundamentally, an Inform Glulx game’s entire job is to communicate with Glk. Inform’s internals and the extension library are designed to protect you from having to think about that, but it is the ultimate truth underlying all Inform code: somewhere down there, somebody’s turning the code you write into Glk function calls, writing printed text to the buffer with glk_put_buffer(), reading text that the user wrote with glk_get_line_stream().
The Glk specification also allows us to define “Glk extensions,” with new functions that you might want to call, with a new gestalt code that authors can check. The idea is that Glulx interpreters (Spatterlight, Gargoyle, Parchment, Lectrote, Windows Glulxe, Fabularium, Frotz) would add support for a Glk extension and publicly agree on a gestalt code. Then, in an Inform extension, you’d write:
Constant gestalt_CSSBasic = $1110;
To decide whether glk css is supported:
(- ( glk_gestalt( gestalt_CSSBasic, 0 ) ) -).
The magic number 1110 is written in Dannii’s CSS specification. Dannii selected that number arbitrarily, out of a reserved block of numbers that Zarf assigned him, to ensure that no two extensions will use the same gestalt number.
Support for these functions can be tested with
gestalt_CSSBasic(Gestalt code0x1110).
Furthermore, each function in an extension is also assigned a standardized number that the interpreter(s) and the author agree on in advance. There’s a fundamental function in Inform, glk(), that accepts a function number and list of I6 function parameters, and calls the Glk function with those parameters, whatever they may be.
Dannii declared that css_inline_set has function code 1113, so you can write this in I6:
[ glk_css_inline_set csstarget prop proplen val vallen;
glk($1113, csstarget, prop, proplen, val, vallen);
];
Then, I6 code can call glk_css_inline_set. You should check the gestalt before you try calling function 1113, but if the gestalt says CSS Basic is available, then you know it will work.
Almost all of this thread has been about figuring out what the Glk CSS functions should do, what they should be called, and how they should work. The idea is that once something becomes possible in I6 code, anyone can make a little Inform extension to make it nicer to use in Inform 7.
What should the Inform 7 extension look like? Whatever we want, I guess?
It’s not very clear to me what Inform 7 authors would find best/easiest. I think some authors would want an API that’s very close to glk_css_inline_set, allowing the author to specify exactly what happens in Glk CSS terms. Off the top of my head, I could imagine a “CSS” extension that lets you write this:
Instead of examining the crystal:
set CSS "color" to "#f00";
set CSS "font-weight" to "bold";
say "The crystal blazes.";
clear CSS "color";
clear CSS "font-weight".
I think the default target would be spans, but you could target other stuff like this, perhaps?
set CSS "text-align" of the next paragraph to "center";
say "Chapter One[line break]";
set CSS "color" of the next hyperlink to "orange";
say "[set link 1]Click here[end link]";
set CSS "border-radius" of the next image to "12px";
display the Figure of logo;
But I think many authors would want a say-based API with a hand-picked list of features:
The Crystal Cave is a room. "A [scarlet]crimson[end colour]
crystal sits on a [bold]stone[end bold] pedestal.
[italic]Something whispers.[end italic]
[larger]WARNING:[end larger] [underlined]do not touch[end underline].
[centered]Chapter One[end centered]
Once upon a time..."
There’s room for both approaches, I think. And, more importantly, any Inform author who comes up with a nicer, smoother way of using CSS can publish their approach as an extension, and people might use it. (If it becomes very popular, it might even become part of Inform’s internals, and get documented in Inform’s documentation.)
It’s about making things possible
The arrival of Glk CSS won’t remove all of the limitations of Glk, letting you do anything you can do in Bisquixe or Vorple.
For example, in Glk, you can’t change anything about a window (e.g. the transcript text buffer) once it’s opened. To set a color scheme before the window opens, maybe you’d write something like:
Before starting the virtual machine:
The background color of the main window is white in light mode and black in dark mode.
The text color of the main window is black in light mode and white in dark mode.
If you want to change the background color as you play, well, too bad, Glk doesn’t allow that. Instead, you have to close and re-open the main window with Flexible Windows, like this:
After going to the pink room:
now the background color of the main window is pink;
close the main window;
open the main window;
open the status window;
try looking.
That erases the entire transcript. ![]()
So, I’ve also been discussing an API to change that. Changing the open window background color in Glk
And, as we’ve been discussing in Boxed quotations in Inform, there’s also no way to make a Glk window pane that floats on top of (or overlaps) another window pane. Neither is there a way to make a Glk window that’s an actual operating-system window, a window that users can resize, minimize, and close.
My hobby lately is to push on the edges of what Glk is capable of, not by exposing all of the web’s features to Inform, as Vorple does, but by adding actual extensions to Glk to make new things possible in interpreters that don’t use web UI.
Once Glk makes more things possible, you can use them in Inform immediately, without waiting for Inform developers to publish a new release.
(That’s lucky, because there was a seven year gap between Inform 9.3 and Inform 10.1. Inform 11 is “coming soon”, but probably not in 2026, which means it will also have at least a four-year gap, possibly more like five or six years, in practice!)
If there was something that worked in Inform 9.3, then it is definitely possible to write I6 in Inform 10 to do it now, because Glk (and its extensions) are what determines what’s actually possible.