fixed the Unwanted border and more - #7971
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe Discuss callout stylesheet now supports responsive logo sizing, block-level rounded card links, suppressed non-visible focus outlines, and simplified button transitions. ChangesDiscuss Callout Styling
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: 🟡 Moderate · up to This localized CSS fix removes leaked global button styling and preserves keyboard focus indication, but lint, Gatsby build, and local visual/functional checks still need to pass before merge. Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/sections/Discuss-Callout/discuss.style.jsParsing error: The keyword 'import' is reserved Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Preview deployment for PR #7971 removed. This PR preview was automatically pruned because we keep only the 3 most recently updated previews on GitHub Pages to stay within deployment size limits. If needed, push a new commit to this PR to generate a fresh preview. |
Description
This PR fixes #7958
The "JOIN THE CONVERSATION" card on the Community page rendered with an unintended white border around its container, and the Layer5 logo inside it appeared with inconsistent, off-brand colors.
While fixing the visible symptoms, I found the underlying cause was not the border declaration alone — the stylesheet had unbalanced braces that were leaking the component's
buttonstyles into the global scope. Both symptoms trace back to that.What was wrong
1. Unintended white border
src/sections/Discuss-Callout/discuss.style.jsstyled the logo button with:border: 2px solidomits a color, so CSS falls back tocurrentColor. The border therefore painted itself using whatever color was inherited at that point — the card's white text — producing the white box seen in the issue screenshot.For comparison, the sibling "Adventures of Five & Friends" card (
src/sections/Adventures-Callout/discuss.style.js), which renders correctly, usesborder: 0; padding: 0;.2. Off-brand / inconsistent logo colors — root cause
The styled-component template literal contained two stray closing braces (one in the
.explainblock, one in themax-width: 1211pxmedia query). These closed the component's style block early, so every rule after them — including the entirebuttonrule — was emitted as a bare globalbuttonselector instead of being scoped to the component.The consequence: this card's
border: 2px solidwas applied to buttons across the site, and collided with the Adventures card's leakedborder: 0. Which one won depended purely on stylesheet injection order, which is exactly why the styling looked arbitrary and inconsistent rather than simply broken.The logo asset itself (
static/images/layer5-discuss-white.webp) was already correct Layer5 branding — white wordmark with the teal5. It only looked wrong because it was boxed inside the spurious bordered, padded container.Changes
All changes are confined to
src/sections/Discuss-Callout/discuss.style.js:border: 2px solid→border: 0, andpadding: 0.2em 1em→padding: 0, bringing the button in line with the working Adventures card.color: #1E2117→color: inheritso no stale color is left to feedcurrentColor.}so thebuttonrule is properly scoped to the component and can no longer leak globally or be decided by cascade order.max-width: 100%; height: autoso it scales within the card without distorting its aspect ratio.<a>using:focus:not(:focus-visible), matching the pattern already used elsewhere in this file. This removes the outline left after a mouse click while preserving the keyboard focus outline, consistent with the recent focus-visible accessibility work in Fix focus-visible outlines #7960 and Fix button focus styling #7962.Verification
Brace balance was confirmed with a depth parser over the template literal:
The file also passes
node --check.Notes for Reviewers
src/sections/Discuss-Callout/index.jsis untouched. This is a CSS-only fix./company/faqand the Learn course-overview pages, so the fix applies there too. Worth a quick look at those while reviewing.:focus-visibleoutlines still render.src/sections/Adventures-Callout/discuss.style.jshas the same latent defect — 2 stray closing braces (around lines 68 and 133) leaking itsbuttonrule globally. It does not affect this fix, since a properly scoped selector now outranks a bare global one. Happy to clean it up in this PR or open a follow-up issue — reviewer's call.Signed commits
Summary by CodeRabbit