livery.extensions.docs._theme¶
livery.extensions.docs._theme ¶
The site's theme block: its default values, and how the answers merge over them.
The docs.theme query's combine function lives here, apart from the
site's verbs, so the declaration can name it and importing it registers
nothing.
Functions:
| Name | Description |
|---|---|
merge_theme |
The theme's values: the default, each key from the nearest answer setting it. |
Attributes:
| Name | Type | Description |
|---|---|---|
THEME |
Query[dict[str, object]]
|
|
THEME_DEFAULT |
dict[str, object]
|
|
THEME_DEFAULT
module-attribute
¶
THEME_DEFAULT: dict[str, object] = {'language': 'en', 'font.text': 'Inter', 'font.code': 'Fira Code', 'features': ['announce.dismiss', 'content.code.annotate', 'content.code.copy', 'content.tooltips', 'navigation.footer', 'navigation.indexes', 'navigation.instant', 'navigation.instant.prefetch', 'navigation.sections', 'navigation.tabs', 'navigation.tabs.sticky', 'navigation.top', 'navigation.tracking', 'search.highlight', 'toc.follow'], 'palette': [{'media': '(prefers-color-scheme)', 'toggle.icon': 'lucide/sun-moon', 'toggle.name': 'Switch to light mode'}, {'media': '(prefers-color-scheme: light)', 'scheme': 'default', 'toggle.icon': 'lucide/sun', 'toggle.name': 'Switch to dark mode'}, {'media': '(prefers-color-scheme: dark)', 'scheme': 'slate', 'toggle.icon': 'lucide/moon', 'toggle.name': 'Switch to system preference'}]}
merge_theme ¶
The theme's values: the default, each key from the nearest answer setting it.
The docs.theme query's combine rule, called with the answers by
extension and the lookup it hands on to
livery.workshop.nearest_extensions. A key one answer sets takes
that answer's value. A key several answers set takes the value of
the one no other of them requires, which builds on the others, so
neither list's order decides it.
Raises:
| Type | Description |
|---|---|
ValueError
|
when an answer is not a table, names a key outside the block's vocabulary, or sets a key another answer sets while neither requires the other; the message names the extensions, and the query is named by the asker. |