Styling input
The display of an Inform game is like text from a printer. Once the words are laid to paper, they cannot change. The command line is different, of course. It changes as players enter their commands. Once the player presses enter, though, their commands become more unchanging words on the page.
Styling “input” can mean more than one thing, then. The dynamic text of the command line has properties, and the newly-static text of issued commands has separate properties.
The command interface is like a window unto itself. It can have a background color, and the text within can be configured normally. For instance, we could specify a blue, cursive font printing over a gray background. A dubious combination, to be sure!
Usually, the container holding input is styled via the .Input class, and the text within it is specified via the .BufferWindow .Input class.
css-set-fast ".BufferWindow .Input; font-size; 30px";
css-set-fast ".BufferWindow .Input; font-family; Brush Script MT";
css-set-fast ".BufferWindow .Input; color; blue";
css-set-fast ".Input; background; gray";
Meanwhile, previously-issued commands inherit properties from .BufferWindow and can be further styled via the .Style_input class. The default template assigns a specific color (black) and weight (bold). If font color has been changed for .BufferWindow, then .Style_input might be altered to match.
css-set-fast ".BufferWindow; color; purple;";
css-set-fast ".Style_input; color; purple;";
css-set-fast ".Style_input; font-weight; bolder";
The font-weight property is used to specify bold type.
It’s important to note that the command prompt itself is not part of this equation! That prints according to properties assigned to .BufferWindow. It is possible to configure it independently using inline substitutions, a more advanced tactic to be discussed later.