Repository navigation
feat: add compactOnMobile to I9kPageHeader - #43
Merged
Merged
Conversation
Up to 768px wide, the header sets its title at a section heading's size and, with an avatar, puts a smaller avatar beside the title instead of a large one above a centred column, with the rest full width below, read from the start edge. Wider viewports are unchanged. 9k.school's instructor introduction drew this with :deep() overrides; this makes it an option of the component. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
A new opt-in prop,
compactOnMobile(defaultfalse), onI9kPageHeader. Up to 768px wide (the header's own breakpoint):--i9k-page-header-compact-title-size, defaultclamp(1.65rem, 3vw, 2.35rem), line height 1.2, nochcap).display: contents, so a smaller avatar and the title share the first row, and the subtitle, description and actions run full width below, read from the start edge. You get this instead of the large avatar stacked above a centred column.I9kAvatarandI9kBandanaAvatarin theavatarslot shrink to--i9k-page-header-compact-avatar-size(default 5.5rem). Other avatar content keeps its own size.Above 768px nothing changes, and without the prop nothing changes at any width.
Why
9k.school's instructor introduction (
app/components/InstructorIntro.vue, released in 26.10.16-03) is anI9kPageHeaderlower on the homepage and the course page. On phones the stacked 14rem photo and display-size title filled the first screen, so the owner asked for a compact version. It shipped as app-side:deep()overrides. 9k.school's rules say reusable layout belongs in the design system, so this PR moves it here, with the same values, so the phone layout does not change.Docs
CompactOnMobile, which opens in the mobile viewport.Verification
npm run checkpasses: 78 files and 1,120 tests, format, lint, typecheck, library build, Storybook build, and the showcase build (60 components).:deep()rules reach the slotted children and the avatars.Merge
Merge with a merge commit or a rebase, not a squash. 9k.school pins this branch's commit (
02acd6e) through its lockfile, so that commit has to stay inmain's history.🤖 Generated with Claude Code