Theme roles
This page lists the roles that a theme of tt can style, how each looks in the built-in theme, and the keys and values of a role.
A theme is the file themes/<name>.toml in the root folder of Tilde, picked by theme in the [ui] table of config.toml. Write only the roles to change:
[roles.Bar]fg = "#eceff4"bg = "#3b4252"How to make and choose a theme is on Themes.
| Role | What it styles | Built-in look |
|---|---|---|
Bar |
The top bar and the bottom bar. | brightwhite on blue |
Selected |
The selected row of the list or tree that has the focus. | black on cyan |
SelectedUnfocused |
The selected row of a list or tree that does not have the focus. | white on brightblack |
Placeholder |
The hint of a text box while nothing is typed. | brightblack text |
Cursor |
The cell of the cursor in the text box that has the focus. Without a style it cannot be seen. | reversed |
ScrollTrack |
The track of the scroll bar of a list, a tree or a text. | brightblack text |
ScrollThumb |
The thumb of the scroll bar, which shows where the visible rows are. | white text |
Muted |
The colour muted of a piece of a bar; only its text colour is used. |
white text |
Success |
The colour success of a piece of a bar. |
brightgreen text |
Warning |
The colour warning of a piece of a bar. |
brightyellow text |
Error |
The colour error of a piece of a bar. |
brightred text |
Border |
The colour border of a piece of a bar. |
cyan text |
Accent |
The colour accent of a piece of a bar. |
brightcyan text |
The built-in theme uses the sixteen colours, so it follows the palette of the terminal. A cell without a role is plain. A role name that nothing uses is accepted and changes nothing, because a screen file may name roles of its own. The case of a name matters.
Keys of a role
Section titled “Keys of a role”Each role is a table [roles.<Role>]. Every key is optional: a key that is written replaces that key of the built-in look, and a key that is left out keeps it.
| Key | Type | Meaning |
|---|---|---|
fg |
colour | The colour of the text. |
bg |
colour | The colour behind the text. |
bold |
boolean | Bold text. |
reverse |
boolean | Swaps the text and the background colours. |
Colours
Section titled “Colours”| Value | Meaning |
|---|---|
black, red, green, yellow, blue, magenta, cyan, white |
One of the eight colours of the terminal. Any case. |
bright + a name, such as brightblack |
The light variant of that colour. |
#rrggbb |
A true colour. |
default |
The colour of the terminal: bg = "default" takes the background off. |
Errors
Section titled “Errors”A file that is not there, is not TOML, has a key other than roles, has an unknown key inside a role, a value of the wrong kind or a colour that is not valid stops tt before the screen opens, with exit code 1 and a message that names the file and the key. A key written twice is not an error: the last one counts. tcli check does not read the theme file.
The code is in Theme.cs, ThemeLoader.cs and RoleNames.cs.