Grimoire CSS sharpens both power and clarity with Scryforge — a release focused on templated scroll composition, rustc-like diagnostics, and measurable performance wins. Spells now expand more deterministically under templated selectors, errors read like a compiler, and large projects build faster with an opt-in multi-core path.
- Scroll Templates Inside
g!…;: Use config-definedscrollsdirectly ing!…;with variable arguments (e.g.g!complex-card=120px_red_100px;) while keeping output deterministic. - Prefix-Safe Expansion: Prefix modifiers like
md__, focus blocks{...}, andhover:are preserved by applying them to each expanded spell. - Rustc-like Diagnostics: Errors render with file context + labeled span + optional help text, powered by a structured error model and
miettediagnostics. - Faster Builds (Same Output): Reduced redundant work and clone/allocation pressure; optional parallel project builds via
GRIMOIRE_CSS_JOBS. - Better Repro & Contributor UX: Added a
repro/sandbox for feature/error scenarios and added.github/copilot-instructions.mdas an architecture guide.
You can now reference scrolls in templated g!…; syntax, including argument passing:
- Example:
g!complex-card=120px_red_100px; - Supports variable-like arguments and prefix modifiers.
- Scroll expansion is flattened into real property spells so generated CSS is emitted under the outer templated selector.
- Output remains deterministic and the template-flattening path avoids unnecessary cloning.
Scrolls expanded under templates keep the semantics that made Grimoire CSS predictable in complex UIs:
- Responsive prefixes like
md__. - Focus blocks using
{...}. - Effects like
hover:.
These prefixes apply to each expanded spell during flattening so behavior matches user intent.
This release substantially upgrades the error/reporting system:
- Introduced
SourceFileto carry file identity + full content, enabling readable snippets for every error. - Parsing now tracks spans (
start,len) for each extracted class/spell token and propagates them through spell generation. - Error model upgraded from plain strings to structured compile errors (message / label / help / span / source).
- Added a diagnostics adapter mapping
GrimoireCssErrortomiette::Diagnosticfor polished CLI output.
User-facing validation got stricter and clearer:
- Better errors for malformed function-like values / parentheses (
spell_value_validator). - Color function argument validation now returns a proper error instead of being silently ignored.
Grimoire CSS stays output-stable while getting faster and leaner:
- Reduced redundant passes and duplicated work.
- Lowered allocation and clone pressure in hot paths.
- Added opt-in parallelism for filesystem builds via
GRIMOIRE_CSS_JOBS.
Safe default remains single-threaded; scaling is opt-in based on machine and project size.
To improve maintenance and debugging velocity:
- Added
repro/containing minimal scenarios for reproducing features and diagnostics. - Added
.github/copilot-instructions.mddocumenting the project’s architecture conventions.
- Optional parallel builds: Set
GRIMOIRE_CSS_JOBSto enable multi-core builds in filesystem mode. Without it, behavior remains unchanged. - Stricter validation: Invalid color function arguments that were previously ignored now raise proper errors (with spans and help text).
- Prefer adding/using minimal scenarios under
repro/when improving parser/diagnostics behavior. - Follow the architecture guide in
.github/copilot-instructions.mdwhen introducing new commands, core pipeline changes, or infrastructure glue.