feat(landing): optional hero logo for DocsUI::Landing (c.landing.logo)#57
Merged
Conversation
DocsUI::Landing's hero was eyebrow + title + lead, with no way to show a product's
own brand mark — the first thing a real consumer hit when adopting it on a mounted
docs app. Add an optional hero logo above the eyebrow, in two forms:
- inline single-path SVG: { svg: "<path d>", viewbox:, label: } — rendered with
fill: currentColor so a single-color mark adapts to the theme (light/dark);
- image: { src:, alt: } — resolved through the site's asset pipeline (image_url).
nil (the default) omits it, so it's fully backwards-compatible. Normalized into a
DocsKit::LandingConfig::Logo value object (like Cta/Feature). Dogfooded on the
docs-kit site (an inline stacked-docs glyph) with a system-spec assertion; the
generator initializer + component docs document it.
Full gem suite 759 green, 94.73% line coverage, rubocop clean; dogfood system +
request specs green.
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.
Why
DocsUI::Landing(shipped in #55 / v1.0.5) renders a hero of eyebrow + title + lead — but no way to show the product's own brand mark. That's the first thing a real consumer hits: adopting the component on a mounted docs app (a fintech app's/docs), the hand-rolled hero had an inline logo, and moving to the gem component would have dropped it. This adds the missing slot so the gem is a strict upgrade for that case.What
An optional
c.landing.logo, rendered above the eyebrow, in two forms:nil(the default) omits it, so it's fully backwards-compatible — an existingDocsUI::Landingrender is byte-identical.DocsKit::LandingConfig::Logovalue object (#hero_logo), mirroringCta/Feature.<svg role="img" aria-label fill="currentColor">with the path; the image form an<img>.c.landing.logo= an inline stacked-docs glyph), with adocs_chromesystem-spec assertion (svg[aria-label='docs-kit']).Tests
spec/docs_kit/landing_config_spec.rb—#hero_logonormalization (inline vs image, default viewbox,inline?).docs/spec/system/docs_chrome_spec.rb— the rendered logo on the dogfood landing.Full gem suite 759 examples, 0 failures, 94.73% line coverage; rubocop clean (131 files); dogfood system + request specs green.
Note
app/components/docs_ui/landing.rbis added to theMetrics/ClassLengthexclude (alongside the OpenAPI composite renderers) — it's a multi-section renderer (logo + hero + feature grid + doc index) where each method is small; the length is section count, not complexity.