Skip to main content

Module syntax

Module syntax 

Source
Expand description

Syntax colours resolved through ishou, so a theme change recolours the CODE and not just the frame. hikari ships one hardcoded Nord table; this reproduces it on the fleet default and extends it to every theme. Syntax colours, resolved through ishou for every theme.

§Why this exists

hikari ships exactly one theme — NordTheme, a table of twenty hardcoded hex literals — and escriba’s GPU face held one by value. So picking Vellum gave you Vellum chrome with Nord code inside it: the frame changed colour and the text did not. That is not a theme; it is a border.

§Why roles reproduce Nord rather than replacing it

The obvious worry with routing syntax through a role vocabulary is that it flattens a rich palette onto too few colours and makes the default look worse. That worry does not survive contact with the numbers: ishou’s SemanticRoles carries 27 roles, and on pleme_dark they resolve to the Nord palette that NordTheme was hand-transcribed from. Nineteen of the twenty HlClass variants land on the identical hex:

classroleNord
Functionprimary#88C0D0
Type / Namespaceinfo#8FBCBB
Keyword / Operatorlink#81A1C1
Str / Addedsuccess#A3BE8C
Numeric / Attributeagent#B48EAD
Boolean / Constantwarning#D08770
Escape / Specialsearch#EBCB8B
Error / Removederror#BF616A
Punctuationtext_bright#ECEFF4
Hyperlink / Hintstructural#5E81AC
Plain / Variabletext_muted#D8DEE9

The single divergence is Comment: NordTheme uses #616E88, the text_dim role resolves to #4C566A. Both are Nord Polar Night, and text_dim is the colour the rest of the fleet already dims with — so escriba’s comments now match escriba’s gutter instead of matching a constant in someone else’s crate. That is stated rather than hidden because it IS a visible change on the default theme.

themes_reproduce_nord_on_the_fleet_default below pins all of this against the real NordTheme, so a future role rebinding that silently moved the default look fails the build.

Structs§

ChromeSyntax
A hikari_core::Theme that answers from a ChromePalette.

Constants§

ALL_CLASSES
Every HlClass variant, for tests and for any consumer that needs to walk the vocabulary (a theme previewer, a contrast audit).