Skip to content

Commit c6aeb29

Browse files
treodenclaude
andcommitted
refactor: dedupe nested page-width and scope checkout layout overrides
The frontStore Base already wraps the content area in `.page-width` (Base.tsx `<Area id="content" className="page-width">`), so page components that re-applied `page-width` were nesting it — a second max-width + 22px padding that indented their content past the rest of the page. Drop the redundant `page-width` from the frontStore page components and shared components that render inside the content area: category/product/search, blog views, cart/checkout, customer account + order pages, CMS page + 404, breadcrumb, and CategoryInfo. The admin 404 dropped it too — `.page-width` is defined only in the frontStore global.scss, so it was a no-op there. Scope the checkout `.wrapper` header/footer overrides to their route body class (`.checkout` / `.checkoutSuccess`) so they stop leaking to every page in dev, where all route CSS is injected globally by style-loader (prod already extracts CSS per route). Section `boxed` now caps at the theme's 1200px page width and centers, so a section stays visibly boxed even when dropped into a full-bleed area instead of relying on an ancestor container to constrain it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c9f67e4 commit c6aeb29

24 files changed

Lines changed: 80 additions & 59 deletions

File tree

packages/evershop/src/components/frontStore/catalog/CategoryInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function CategoryInfo() {
2020
priority={true}
2121
/>
2222
)}
23-
<div className="category__info prose prose-base page-width">
23+
<div className="category__info prose prose-base">
2424
<h1 className="category__name">{name}</h1>
2525
<div className="category__description">
2626
<Editor rows={description} />

packages/evershop/src/modules/base/pages/frontStore/all/Breadcrumb.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface BreadcrumbProps {
1919

2020
function Breadcrumb({ pageInfo: { breadcrumbs } }: BreadcrumbProps) {
2121
return breadcrumbs.length ? (
22-
<div className="page-width">
22+
<div>
2323
<div className="py-5">
2424
<BreadcrumbRoot>
2525
<BreadcrumbList>

packages/evershop/src/modules/blog/pages/frontStore/blogCategoryView/BlogCategoryView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function BlogCategoryView({
2424
}
2525
const items = category.posts?.items || [];
2626
return (
27-
<div className="blog-category page-width py-8">
27+
<div className="blog-category py-8">
2828
<h1 className="text-3xl font-bold mb-2">{category.name}</h1>
2929
{category.shortDescription && (
3030
<p className="text-gray-600 mb-6">{category.shortDescription}</p>

packages/evershop/src/modules/blog/pages/frontStore/blogHome/BlogHome.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function BlogHome({
1717
}) {
1818
const items = blogPosts?.items || [];
1919
return (
20-
<div className="blog-home page-width py-8">
20+
<div className="blog-home py-8">
2121
<h1 className="text-3xl font-bold mb-6">{_('Blog')}</h1>
2222
{items.length === 0 ? (
2323
<p className="text-gray-500">{_('No posts published yet.')}</p>

packages/evershop/src/modules/blog/pages/frontStore/blogPostView/BlogPostView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function BlogPostView({ post }: BlogPostViewData) {
3838
return null;
3939
}
4040
return (
41-
<div className="blog-post-single page-width">
41+
<div className="blog-post-single">
4242
<article className="max-w-3xl mx-auto py-8">
4343
{post.category && (
4444
<a

packages/evershop/src/modules/blog/pages/frontStore/blogTagView/BlogTagView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function BlogTagView({
2323
}
2424
const items = tag.posts?.items || [];
2525
return (
26-
<div className="blog-tag page-width py-8">
26+
<div className="blog-tag py-8">
2727
<p className="text-sm uppercase tracking-wide text-gray-500 mb-1">
2828
{_('Tag')}
2929
</p>

packages/evershop/src/modules/catalog/pages/frontStore/catalogSearch/SearchPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function SearchPage({ search }: SearchPageProps) {
1616
return (
1717
<SearchProvider searchData={search}>
1818
<Area id="searchPageTop" className="search__page__top" />
19-
<div className="page-width grid grid-cols-1 ">
19+
<div className="grid grid-cols-1 ">
2020
<SearchInfo />
2121
<SearchProducts />
2222
</div>

packages/evershop/src/modules/catalog/pages/frontStore/categoryView/CategoryView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function CategoryView({ category }: CategoryViewProps) {
2020
<CategoryProvider category={category}>
2121
<Area id="categoryPageTop" className="category__page__top" />
2222
<CategoryInfo />
23-
<div className="page-width grid grid-cols-1 md:grid-cols-4 gap-5">
23+
<div className="grid grid-cols-1 md:grid-cols-4 gap-5">
2424
<Area
2525
id="categoryLeftColumn"
2626
className="md:col-span-1"

packages/evershop/src/modules/catalog/pages/frontStore/productView/ProductView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function ProductView({ product }: ProductData) {
1515
<ProductProvider product={product}>
1616
<div className="product__detail">
1717
<Area id="productPageTop" className="product__page__top" />
18-
<div className="product__page__middle page-width">
18+
<div className="product__page__middle">
1919
<div className="grid grid-cols-1 gap-7 md:grid-cols-2">
2020
<Area
2121
id="productPageMiddleLeft"

packages/evershop/src/modules/checkout/pages/frontStore/cart/ShoppingCart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface ShoppingCartProps {
2424
export default function ShoppingCart({ checkoutUrl }: ShoppingCartProps) {
2525
const { data: cart } = useCartState();
2626
return (
27-
<div className="cart page-width">
27+
<div className="cart">
2828
{cart.items.length > 0 ? (
2929
<>
3030
<Title title={_('Shopping Cart')} />

0 commit comments

Comments
 (0)