Skip to main content

Theme Variables

Theme Variables are not supported for all graphs, these may offer a style(s) line which allows fine tuning styling. For the graphs supporting theme variables, you can use Siren to write them into the YAML frontmatter.

---
config:
themeVariables:
git0: red
commitLabelColor: blue
gitBranchLabel0: green
---
gitGraph
commit
branch developer
commit
commit

Usage

siren.git [
git.commit()
git.branch "developer"
git.commit()
git.commit()
]
|> siren.addThemeVariable(gitTheme.git0 "red")
|> siren.addThemeVariable(gitTheme.commitLabelColor "blue")
|> siren.addThemeVariable(gitTheme.gitBranchLabel0 "green")
|> siren.write

In case you cannot find a specifc config option you are looking for, you can always use:

themeVariable.custom(configName, configValue)

Here an example in C# using themeVariable.custom.

siren.git([
git.commit(),
git.branch("developer"),
git.commit(),
git.commit(),
])
.addThemeVariable(themeVariable.custom("git0", "red"))
.addThemeVariable(themeVariable.custom("commitLabelColor", "blue"))
.addThemeVariable(themeVariable.custom("gitBranchLabel0", "green"))
.write();