mirror of
https://github.com/danth/stylix
synced 2024-11-10 14:44:16 +00:00
doc: explain using lib.stylix.colors
(#328)
The attrset is used heavily in styllix's modules, but the docs don't contain even a top-level explanation of its value. Though you can gather most it from skimming `base16.nix`, I think stylix should provide an entry point for users, interested in using their color schemes outside of stylix. I base this assumption on personal anecdote of people not having a good understanding of exported values even after extended usage and implementing parallel parsing logic for color scheme files.
This commit is contained in:
parent
4a4c82f03c
commit
76e7daf5a1
1 changed files with 31 additions and 0 deletions
|
@ -69,6 +69,37 @@ and the user-provided one are used in the user configuration if
|
||||||
`stylix.base16Scheme` is not changed in the user config. If that is the case,
|
`stylix.base16Scheme` is not changed in the user config. If that is the case,
|
||||||
only the user override is used.
|
only the user override is used.
|
||||||
|
|
||||||
|
### Extending
|
||||||
|
|
||||||
|
When passing colors to unsupported targets or creating custom modules, it
|
||||||
|
is possible to access values from the configured color scheme through
|
||||||
|
`lib.stylix.colors`.
|
||||||
|
An overview of the available values is shown below.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
lib.stylix.colors = {
|
||||||
|
base08 = "ff0000";
|
||||||
|
base08-hex-r = "ff";
|
||||||
|
base08-dec-r = "0.996094";
|
||||||
|
# ...
|
||||||
|
red = "ff0000";
|
||||||
|
# ...
|
||||||
|
withHashtag = {
|
||||||
|
base08 = "#ff0000";
|
||||||
|
# ...
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
This attrset is generated by `mkSchemeAttrs` from `base16.nix`. Refer to the
|
||||||
|
[documentation](https://github.com/SenchoPens/base16.nix/blob/main/DOCUMENTATION.md#mkschemeattrs)
|
||||||
|
for more info.
|
||||||
|
|
||||||
|
For more complex configurations you may find it simpler to use
|
||||||
|
[mustache](http://mustache.github.io/) templates to generate output files.
|
||||||
|
See [base16.nix](https://github.com/SenchoPens/base16.nix) documentation for
|
||||||
|
usage examples.
|
||||||
|
|
||||||
## Fonts
|
## Fonts
|
||||||
|
|
||||||
The default combination of fonts is:
|
The default combination of fonts is:
|
||||||
|
|
Loading…
Reference in a new issue