YPE-2573 - Center Bible card content#243
Open
cameronapak wants to merge 4 commits into
Open
Conversation
Remove the outer BibleCard max width while keeping the rendered card content centered at a readable line length. This lets host layouts size the card while preserving balanced whitespace inside wide containers.
Center the VerseOfTheDay content within a full-width card and update Storybook framing for realistic width behavior. Keep card shells border-box so full-width cards fit narrow containers without adding minimum widths.
🦋 Changeset detectedLatest commit: 1627682 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Add a minor changeset for the card layout update so the UI package version captures the new full-width centered card behavior.
Keep BibleTextView readable by default while moving card layout constraints into Tailwind classes. Remove tests that only checked inline style state instead of real layout behavior.
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
Ticket
https://lifechurch.atlassian.net/browse/YPE-2573
Test plan
Greptile Summary
This PR replaces the fixed
max-widthonBibleCardandVerseOfTheDaywith a newcard-contentCSS utility that lets the outer section fill its container while centering a 600 px content group inside. Thebible-reader.cssmax-widthis also migrated to a CSS variable with65chas the default, preserving the original readability constraint while enabling future overrides.BibleCard/VerseOfTheDay:yv:max-w-mdremoved from the outer<section>;yv:box-borderadded; all children wrapped in<div class="yv:card-content">which applieswidth:100%; max-width:600px; margin-inline:auto.global.css: New@utility card-contentimplements the centering contract for both cards.WideContainerintegration stories added withgetBoundingClientRect()assertions that verify the content group is ≤ 600 px wide and horizontally centered; unit tests updated to assert the new class structure.Confidence Score: 5/5
Safe to merge — this is a pure layout refactor with no logic changes; the centering mechanism is well-tested by both unit tests and new integration stories.
All changes are CSS and component-structure only. The new card-content utility correctly applies width:100%; max-width:600px; margin-inline:auto, and box-sizing:border-box on the outer section ensures padding does not cause overflow. The bible-reader.css change preserves the 65ch readability default while adding a CSS-variable escape hatch. Integration stories validate the actual visual centering with getBoundingClientRect() assertions.
No files require special attention.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["Consumer container\n(any width)"] --> B B["section .yv:w-full .yv:box-border\n(fills container, padding included in width)"] B --> C["div .yv:card-content\nwidth:100%, max-width:600px\nmargin-inline:auto"] C --> D["Header row\n(reference + version picker)"] C --> E["AnimatedHeight\n→ BibleTextView\nmax-width: var(--yv-reader-max-width, 65ch)"] C --> F["Footer / Copyright"] style B fill:#dbeafe,stroke:#3b82f6 style C fill:#dcfce7,stroke:#16a34a style E fill:#fef9c3,stroke:#ca8a04Prompt To Fix All With AI
Reviews (2): Last reviewed commit: "fix(ui): address card layout feedback" | Re-trigger Greptile