ChirpUI CSS-verify contract (#157 child 2).
When chirp-ui is active (use_chirp_ui(app)), app templates that emit
chirpui-*class tokens should resolve to classes defined in the shipped
chirp-ui stylesheet. Unknown tokens are almost always typos or stale markup
after a library upgrade — the same class of silent visual breakage that
check_macro_css() catches when chirp-ui
is inactive.
This rule is the symmetric complement: it fires when chirp-ui is active and
a literalclass= attribute references a chirpui-*token that does not
exist in the installed chirp-ui CSS partials.
Severity isWARNINGby default and can be promoted via
app.override_contract_severity("chirpui_css_verify", Severity.ERROR).
contracts.rules_chirpui_css_verify
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
_known_chirpui_css_classes
function
def _known_chirpui_css_classes() -> frozenset[str] | None
Return everychirpui-*class selector from the installed chirp-ui CSS.
No parameters.
check_chirpui_css_verify
function
def check_chirpui_css_verify(template_sources: Mapping[str, str], *, chirpui_active: bool) -> list[ContractIssue]
Flag unknownchirpui-*class tokens when chirp-ui CSS is active.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
template_sources
|
Mapping[str, str]
|
— | |
chirpui_active
|
bool
|
— |