Skip to content

docs: Canvas Candy full class catalogue — gap analysis - #32

Merged
LeslieOA merged 2 commits into
developfrom
docs/canvas-candy-catalogue
Oct 4, 2026
Merged

LeslieOA merged 2 commits into
developfrom
docs/canvas-candy-catalogue

Conversation

@LeslieOA

@LeslieOA LeslieOA commented May 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds docs/canvas-candy-catalogue.md: every decoration upstream Canvas Candy defines, marked supported or gap. It is the research part of #19, checked against upstream's CSS (.obsidian/snippets/canvas-candy.css), not only its class list.

Findings

  • Everything in upstream's cssclasses list is supported, as are the header, footer, label and centre callouts with their -noborder variants (callouts.ts, tested in test(renderer): Canvas Candy callout-zone conformance (#16, slice 3) #82).
  • Two real gaps:
    • Image callouts, >[!cc-image-cover] and >[!cc-image-clip]. callouts.ts doesn't know them, so the raw marker shows in the card.
    • Stickers: image file nodes whose file name contains -cc-image lose their border, background and label upstream. We draw them as ordinary file nodes.
  • cc-shape-parallelogram, unsuffixed, is in upstream's list but has no CSS rule. Nothing to port.

Corrected in review

The first version of this catalogue misfiled eleven classes: it listed the header, footer and label callouts as a CSS-class mechanism to skip, the image callouts as cssclasses that clip to the card outline, and the unsuffixed parallelogram as a missing alias. The rewrite is in the second commit.

Verification

Docs only. npm test, npm run typecheck and npm run lint pass.

Refs #19

🤖 Generated with Claude Code

#19 was sized L because most of the cost was *research*: read the
upstream plugin, enumerate every cc-* class, compare against our
baseline, decide which are gaps worth closing. This commit does that
research as a single doc and proposes a sub-issue split that turns
the residual code work into S / XS chunks.

Source for the upstream catalogue:
github.com/TfTHacker/obsidian-canvas-candy — specifically
04 List of Decorations.md, the canonical class index.

Findings

Already supported (28 classes): all shapes, all card fill, all
borders, all 8 documented gradient degrees plus any integer via our
regex, all rotation classes plus any integer via our regex, text
alignment.

Net new gaps (3 classes worth implementing):

  cc-shape-parallelogram  — alias for -left, XS direct port
  cc-image-cover          — S direct port, reuses existing
                            backgroundStyle:'cover' Skia path
  cc-image-clip           — M new render primitive, needs card-shape
                            clip plumbed into SkiaImageRenderer

Deliberate-skip candidates (9 classes): cc-header / cc-footer /
cc-label-{left,right} and their -noborder variants. These are
upstream's CSS-class mechanism for zone-style callouts; we already
expose the same zones via block syntax in extensions/callouts.ts.
Supporting both mechanisms doubles the maintenance surface for the
same visual effect. Doc recommends documenting the mismatch and
optionally adding an import-time conversion pass rather than parallel
support — open question for the maintainer.

Where we're more permissive than upstream (no work needed):

  gradient deg     — upstream documents 8 multiples of 45°; we accept
                     any integer via regex
  card rotation    — upstream documents only -45; we accept any int
  text rotation    — upstream documents 8 multiples of 45°; we accept
                     any int plus an undocumented trailing 'l' variant

Open questions enumerated at the end of the doc:

  1. Confirm skip on 9 callout-zone CSS classes
  2. Verify cc-shape-parallelogram default direction (-left vs -right)
  3. Priority order for the 3 feature gaps
  4. File sub-issues now or wait for consumer demand?

Proposed sub-issue split (post-review):

  feat(candy): cc-shape-parallelogram alias                  XS
  feat(candy): cc-image-cover for text / file nodes          S
  feat(candy): cc-image-clip (card-shape image clipping)     M
  docs(candy): document skipped callout-zone classes         XS

Total code work is closer to S after split — most of #19's original
L sizing was this research, now resolved.

No code changes. Library checks pass on this branch (38/38 tests,
typecheck clean, lint exit 0).

Refs: #19

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@LeslieOA
LeslieOA force-pushed the docs/canvas-candy-catalogue branch from 9a43e51 to a8c0604 Compare October 4, 2026 20:09
Review of #32 before landing. The catalogue had upstream's class list
right but misfiled eleven of the classes:

- cc-header, cc-footer, cc-label-left and cc-label-right, with their
  -noborder variants, were listed as a CSS-class mechanism we skip. They
  are callouts (>[!cc-header]), which callouts.ts has supported all
  along, -noborder included.
- cc-image-cover and cc-image-clip were listed as cssclasses, with a
  card-outline clip as the effect. They are callouts that lay an image
  over the card; "clip" is an invalid object-fit value, so it stretches.
  They are a real gap: the raw marker shows in the card today.
- cc-shape-parallelogram was listed as a missing alias. Upstream's CSS
  defines only -left and -right, both of which we support.

It also adds the sticker convention (file names containing -cc-image),
which upstream's list leaves out, and drops the references to #29, which
was closed; the conformance tests landed as #67, #68 and #82.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LeslieOA
LeslieOA merged commit 9c4f75a into develop Oct 4, 2026
1 check passed
@LeslieOA
LeslieOA deleted the docs/canvas-candy-catalogue branch October 4, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant