summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDLFW <daniel@llin.info>2023-06-25 20:47:23 +0200
committerGitHub <noreply@github.com>2023-06-25 14:47:23 -0400
commitee607354077375be6afc2e62abba7ac4b5c0190a (patch)
treea0a4f375e47225fddb580887e821950b7baedee8 /docs
parentf95658b72c184b15183b5fc8db517cf9688638a7 (diff)
Tab theme configurable (#317)
Text style for tabs can be configured within `theme.toml` with the dotted keys `tab.active` and `tab.inactive`. The default style is the same as the former hard-coded style. `theme.toml` has been restructured and comments have been added to give a short documentation on each style item. The documentation (`theme.toml.md`) has been enhanced, and the excerpt of `theme.toml` with additional comments has been removed from there. That way it should be easier for devs to keep docs and the default `theme.toml` in sync, and easier for users when the detail comments can be found in the configuration file itself. The conversion from `AppStyle` to `tui::style::Style` is now provided as a function of `AppStyle` and a `From`-implementation for `Style` to avoid having the same factory code repeating all over.
Diffstat (limited to 'docs')
-rw-r--r--docs/configuration/theme.toml.md110
1 files changed, 39 insertions, 71 deletions
diff --git a/docs/configuration/theme.toml.md b/docs/configuration/theme.toml.md
index 8af774a..e946be6 100644
--- a/docs/configuration/theme.toml.md
+++ b/docs/configuration/theme.toml.md
@@ -1,11 +1,14 @@
# theme.toml
-This file is used to theme joshuto
+This file is used to theme Joshuto.
-## Style
+As of now, all theming items are "text style" items where one can define the
+background color and the foreground color, and enable some font attributes.
-Each style has the following fields:
+## Style options
+
+Each style allows the following fields:
```toml
# background color
bg = "light_blue"
@@ -15,81 +18,46 @@ bold = false
underline = false
invert = false
```
+Each field is optional. If omitted, it defaults to the terminal default.
+
## Color
-Joshuto supports 16 colors as well as hex colors via `rgb(r,g,b)`
+Joshuto supports 16 colors as well as hex colors via `rgb(r,g,b)`.
+The 16 default colors are:
+* `black`
+* `red`
+* `blue`
+* `green`
+* `yellow`
+* `magenta`
+* `cyan`
+* `white`
+* `gray`
+* `dark_gray`
+* `light_red`
+* `light_green`
+* `light_yellow`
+* `light_blue`
+* `light_magenta`
+* `light_cyan`
-```
-black
-red
-blue
-green
-yellow
-magenta
-cyan
-white
-gray
-dark_gray
-light_red
-light_green
-light_yellow
-light_blue
-light_magenta
-light_cyan
-_
-```
-## Theme
+## Configuration Items
-joshuto supports theming via system file types as well as extensions
+You can find a complete list of the available configuration items with their default
+values and short explanations as comment in
+[`theme.toml`](https://github.com/kamiyaa/joshuto/blob/main/config/theme.toml).
-System file types include:
+In general, `theme.toml` allows to specify the style of a few UI "widgets",
+and the file entries in the file lists.
-```toml
-# for selected files
-[selection]
-fg = "light_yellow"
-bold = true
-
-# for executable files
-[executable]
-fg = "light_green"
-bold = true
-
-# default theme
-[regular]
-fg = "white"
-
-# for directories
-[directory]
-fg = "light_blue"
-bold = true
-
-# for symlinks
-[link]
-fg = "cyan"
-bold = true
-
-# for invalid symlinks
-[link_invalid]
-fg = "red"
-bold = true
-
-# for sockets
-[socket]
-fg = "light_magenta"
-bold = true
-```
+The file entries can be styled by their basic system file type and by their extension.
+The extension-specific style overrides the basic style.
-Via extensions
+Special file entries (as of now, executable files and invalid symlinks) have
+a specific style that overrides the former file-type-styles.
+
+Last but not least, there are styles for _selected_ files which override all the former
+styles.
-```toml
-[ext]
-[ext.jpg]
-fg = "yellow"
-[ext.jpeg]
-fg = "yellow"
-[ext.png]
-fg = "yellow"
-```