Labels and styles
Labels #
labels replaces any of the words charon writes around a page. Set lang
beside it, for the lang attribute and the date format:
{
"lang": "ja",
"labels": {
"onThisPage": "このページ",
"previous": "← 前へ",
"next": "次へ →",
"results": "{count} 件"
}
}
{heading} and {count} are filled in:
| Key | Default |
|---|---|
docs |
Docs, the sidebar's label |
menu |
Docs menu |
moreDocs |
More docs, the previous and next links' label |
onThisPage |
On this page |
previous, next |
← Previous, Next → |
lastUpdated |
Last updated |
linkTo |
Link to {heading} |
search, searchDocs |
Search, Search docs |
navigate, open, close |
navigate, open, close: the search key hints |
oneResult, results |
1 result, {count} results |
noMatches |
No matches found. |
searchFailed |
Search failed. Try again in a moment. |
DEFAULT_LABELS from @memomori/charon/docs/labels holds them all.
Styles #
docs-site.css is the whole default theme: charon's page styles, the module
styles, docs.css and docs-layout.css.
docs.cssstyles the sidebar, "On this page", previous and next, and the search dialog, all from the--charon-*tokens.docs-layout.csslays out the header and the three columns.
Change colors through the tokens, as on any charon page. The search dialog takes four tokens of its own, each with a fallback:
| Token | Used for | Fallback |
|---|---|---|
--docs-surface |
dialog background | Canvas |
--docs-surface-subtle |
dialog footer | --charon-code-inline-background |
--docs-faint |
icons and secondary text | --charon-captions |
--docs-highlight |
matched words | a pale yellow |
To restyle the CLI's site, give it a template that links your
own stylesheet after _charon/docs.css.