Repository navigation
swatches: add a match mode and extra delimiters, per site, language and block - #6
Merged
Merged
Conversation
…nd block Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s no swatch Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ewels
force-pushed
the
feat/swatch-match-modes
branch
from
October 5, 2026 10:30
1bcf8ee to
2396233
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4
Outside stylesheets, a colour gets a swatch only when it looks like a value: after
:,=,,,(or a quote, and before,,;,),},]or the end of the line. That misses colours in syntaxes such as nf-metro's%%metro line: main | Main | #4CAF50, and a site had no way to fix it.New
swatchesoptions:match: 'value' | 'all'(default'value').'all'gives every hex colour and colour function in a block a swatch, as in stylesheets. The guards stay on:#123/#1234and short all-letter hex such as#addstill get no swatch outside quotes, and named colours still need quotes.delimiters: { before?: string[]; after?: string[] }(default{}). Extra text allowed before and after a colour that looks like a value. It adds to the built-in delimiters.byLanguage: Record<string, { match?, delimiters? }>(default{}). Per-language settings, which replace the sitematchanddelimitersfor that language.languagesstays as it is (it picks which blocks are scanned), because a map there could not say "all languages, plus these settings".swatches.match="all"/swatches.match="value"for one block. A bad value warns and the block uses the site or language setting.Defaults are unchanged. The decision and the rejected shapes are in
.agents/DECISIONS.md. The docs page, the options and attributes reference and the skill are updated.pnpm lint,pnpm test,pnpm lint:docsandpnpm docs:buildpass with no warnings.🤖 Generated with Claude Code