Documentation
¶
Overview ¶
Package looks reads the desktop app's looks. Each look is a folder in web/looks with a look.css that paints it and, in TOML between +++ lines at the top of its first comment, says what it is:
/* +++ id = "witch" name = "Witchcraft" … +++ The Witchcraft look (Settings › Look): … */
Plain's look.css only describes it: its colors are style.css's. Everything else that names the looks is made from those folders: the Settings › Look menu and its options, the stylesheet the pages load (bundle/looks.css), the look the app accepts in its settings, the tests every look must pass, the website's gallery and the GUI README's pictures.
docs/looks.md says how to add one, and
go run ./internal/newlook <folder> "<Name>"
starts one.
Index ¶
Constants ¶
const ( ReadmeBegin = "<!-- looks: " + Generated + " -->" ReadmeEnd = "<!-- end looks -->" )
The GUI README's section on the looks is between these lines.
const Generated = "Generated by go generate from each look's web/looks/<folder>/look.css. DO NOT EDIT. See docs/looks.md."
Generated says, at the top of each file made from the looks, where it comes from. It opens web/bundle/looks.css as a CSS comment, so it must not hold the comment's end, */: a path glob like looks/*/look.css ended the comment early, and the rest of it hid the first rule, the Teletype paper's colours.
Variables ¶
This section is empty.
Functions ¶
func Readme ¶
Readme returns the GUI README, readme, with its section on the looks made again from all.
func SiteData ¶
SiteData is site/data/looks.toml, for the website's looks band and its lists of the looks. Hugo reads it as site.Data.looks, with the looks as its "looks".
Types ¶
type Hero ¶
type Hero struct {
Light string `toml:"light"`
Dark string `toml:"dark,omitempty"`
Alt string `toml:"alt"`
}
Hero is a picture, light and dark, for the website.
type Look ¶
type Look struct {
// ID is the look's value for the look setting and the pages'
// data-look attribute, such as "tty"; its CSS selects
// :root[data-look="tty"]. Plain's is empty. Lowercase letters and
// digits, starting with a letter.
ID string `toml:"id"`
// Name is what Settings › Look and the docs call it, such as
// "Teletype".
Name string `toml:"name"`
// Order places it in the Look menu and the galleries, lowest first.
Order int `toml:"order"`
// Since is the release that brought it, such as "1.4".
Since string `toml:"since"`
// Description is a sentence or two for Settings › Look, shown under
// the menu while the look is chosen.
Description string `toml:"description"`
// Tagline finishes the website's "Plain for every day, Teletype
// for …" sentence: "for fan-fold paper and green phosphor".
Tagline string `toml:"tagline"`
// TextSize is the text size, in percent, the look's CSS sets with
// --text-scale, for the Text size slider. 0 is 100.
TextSize int `toml:"textSize,omitempty"`
// Tokens is the prefix of the CSS custom properties the look adds
// to the plain look's, such as "--tty-". Each must be set in the
// dark palette as well as the light one.
Tokens string `toml:"tokens,omitempty"`
// ContrastGaps excuses the look from TestLookContrast, for the
// older looks whose gaps the accessibility audit lists. A new look
// leaves it out and passes.
ContrastGaps bool `toml:"contrastGaps,omitempty"`
// Texture, if set, shows the texture checkboxes in Settings › Look
// while the look is chosen.
Texture *Texture `toml:"texture,omitempty"`
// Hero is the look's picture in the website's looks band, from
// site/static/images/app/. Taken from a release build, so a new
// look can leave it out until then.
Hero *Hero `toml:"hero,omitempty"`
// Screenshots are the look's pictures in the GUI README, from
// site/static/images/gui/.
Screenshots []Shot `toml:"screenshots,omitempty"`
// Dir is the look's folder in web/looks.
Dir string `toml:"-"`
}
Look is what a look's look.css says of it, in its front matter.
type Texture ¶
type Texture struct {
Label string `toml:"label"`
Sprockets string `toml:"sprockets,omitempty"`
Rules string `toml:"rules,omitempty"`
Shadows string `toml:"shadows,omitempty"`
}
Texture names the texture switches a look draws, by the settings they turn off (noSprockets, noRules, noShadows), and the group's label. A switch with no name isn't shown.