refactor(Container): migrate Container styles from SCSS to Tailwind CSS #8047#8106
refactor(Container): migrate Container styles from SCSS to Tailwind CSS #8047#8106Deven14125 wants to merge 1 commit intowebpack:mainfrom
Conversation
Replace the Container SCSS-based layout with Tailwind utility classes. Removed Container.scss and its import, updated Container.jsx to render <div className="w-full max-w-5xl mx-auto ..."> and adjusted related snapshot. Also updated Footer to use the new max-w-5xl class so layout remains consistent. This migrates layout styling from a component SCSS file to utility classes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Migrates the Container component from SCSS-based styling to Tailwind utility classes, updating dependent layout/snapshots to reflect the new class names and widths.
Changes:
- Replaced
Container.scssusage with Tailwind classes inContainer.jsxand removed the SCSS file. - Updated
Containersnapshots to match the new renderedclassattribute. - Adjusted
Footercontainer width utilities to align with the updated Container sizing.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/components/Footer/Footer.jsx | Updates the Container wrapper width utilities in the footer layout. |
| src/components/Container/snapshots/Container.test.jsx.snap | Updates snapshots to reflect Tailwind-based class names. |
| src/components/Container/Container.scss | Removes legacy SCSS styles for .container. |
| src/components/Container/Container.jsx | Replaces .container class with Tailwind utilities for width/centering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <div className={`w-full max-w-5xl mx-auto ${className}`}> | ||
| {props.children} |
There was a problem hiding this comment.
Using a template literal with ${className} causes an extra trailing space in the rendered class attribute when className is empty (visible in the updated snapshot). Consider joining class names conditionally (or trimming) to avoid unnecessary whitespace and snapshot churn.
|
|
||
| return <div className={`container ${className}`}>{props.children}</div>; | ||
| return ( | ||
| <div className={`w-full max-w-5xl mx-auto ${className}`}> |
There was a problem hiding this comment.
Removing the container CSS class from the Container root breaks existing SCSS selectors that rely on it (e.g. src/components/Splash/Splash.scss targets .splash__section .container for padding). Consider keeping a stable container class on this element for backward compatibility, or update the remaining SCSS/call sites that depend on .container to use Tailwind utilities instead.
| <div className={`w-full max-w-5xl mx-auto ${className}`}> | |
| <div className={`container w-full max-w-5xl mx-auto ${className}`}> |
| const Footer = () => ( | ||
| <footer className="w-full flex-[0_0_auto] print:hidden"> | ||
| <Container className="mx-auto max-w-[900px] px-5 pb-[30px] pt-[40px] text-center [&_a]:text-[#3b7eb5]"> | ||
| <Container className="mx-auto max-w-5xl px-5 pb-[30px] pt-[40px] text-center [&_a]:text-[#3b7eb5]"> |
There was a problem hiding this comment.
Container now already applies max-w-5xl mx-auto, so adding mx-auto max-w-5xl again at the call site is redundant and makes it easier for these to drift out of sync later. Suggest dropping those two utilities from this className (keep the padding/typography utilities) and let Container own the width/centering.
| <Container className="mx-auto max-w-5xl px-5 pb-[30px] pt-[40px] text-center [&_a]:text-[#3b7eb5]"> | |
| <Container className="px-5 pb-[30px] pt-[40px] text-center [&_a]:text-[#3b7eb5]"> |
|
We already have a PR for this - #8098, please before sending a PR check if we already have it to avoid duplication |
Part of #8047
Description
This PR migrates the Container component styles from SCSS to Tailwind CSS.
Changes Made
Container.scssfile and its importTesting
classNameNotes