fix(approach): prefer element icons over the numbered digit - #182
Merged
Conversation
Align numbered: true with the cards convention of per-element named
icons, instead of always overriding to a bare digit. When numbered
and an element sets icon, that icon renders in the tinted circle
(resolved exactly like any element icon: family prefix optional,
bare names go through defaultFamily). Only elements without an icon
fall back to the bare digit glyph. Applies in both the card grid and
the split layout; per-element image is still always ignored.
Root cause this addresses: the bare-digit fallback only renders a
visible glyph when the resolved icon family ships plain digit names
(fas, fi-* do). Bootstrap Icons ("bi") does not — it only has
compound names like "1-circle" — so a numbered block on a site
defaulting to "bi" rendered empty circles. Confirmed by smoke-
testing against gethinode/hinode's own exampleSite, which sets
defaultFamily to "bi": with an explicit element icon like
"1-circle", the badge now resolves a real "bi" glyph instead of the
missing "bi/1.svg" the old bare-digit path asked for.
Documents the family requirement in the component comment,
approach.bookshop.yml's numbered field, and approach.yml's comment
and example (now mixes element icons with an icon-less element to
show both paths in one block).
Default (no numbered, no layout) path re-verified byte-identical.
Extended the four-combination render check to five: grid/split x
(no-icon digit fallback, mixed element-icon-and-fallback) plus the
existing split-without-numbered case; inspected rendered HTML
directly for each.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
🎉 This PR is included in version 2.3.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Summary
Follow-up to #181. On sites whose icon
defaultFamilyhas no bare digit names — including hinode's own exampleSite default (bi, Bootstrap Icons) —numbered: truerendered empty badges withCannot find iconerrors, because the auto-digit fallback assumed the family ships1…9glyphs.Fix, aligned with the cards convention: a numbered element's own
iconnow takes precedence in the tinted circle (resolved like any element icon, in both grid and split layouts); the bare-digit auto-numbering remains as the fallback for families that ship digit glyphs (fas, Flaticon families, …). The family requirement is documented in theapproach.ymlargument spec, and the example there shows explicit icons with the digit fallback.Verification
defaultFamily = "bi"): with explicit1-circle/2-circle/3-circleelement icons the badges render realbiSVG symbols; the previousCannot find icon: bi/1.svgerrors are gone.A companion mod-docs example update (explicit icons) is staged on gethinode/mod-docs#131.
🤖 Generated with Claude Code