replace Tailwind utilities in layout + page templates with CSS (Phase 5a)
Absorb ~100 Tailwind utility classes from layout.ex and all page templates into semantic CSS rules in components.css. Uses theme font-size vars (--t-text-small, --t-text-caption) instead of rem to respect the theme's em-based scaling system. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -335,12 +335,25 @@
|
||||
font-size: var(--t-text-small);
|
||||
}
|
||||
|
||||
/* ── Page container (shared responsive centering) ── */
|
||||
|
||||
.page-container {
|
||||
max-width: 80rem;
|
||||
margin-inline: auto;
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
|
||||
/* ── Shop container (body-level defaults) ── */
|
||||
|
||||
.shop-container {
|
||||
background-color: var(--t-surface-base);
|
||||
font-family: var(--t-font-body);
|
||||
color: var(--t-text-primary);
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.shop-container[data-bottom-nav] {
|
||||
padding-bottom: 5rem;
|
||||
}
|
||||
|
||||
/* ── Shop header ── */
|
||||
@@ -350,11 +363,13 @@
|
||||
border-bottom: 1px solid var(--t-border-default);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.shop-logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
@@ -362,6 +377,7 @@
|
||||
.shop-logo-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@@ -377,24 +393,39 @@
|
||||
}
|
||||
|
||||
.shop-nav {
|
||||
display: none;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.shop-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.header-icon-btn {
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
color: var(--t-text-secondary);
|
||||
border-radius: var(--t-radius-button);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:where(button) {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
& svg {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.cart-badge {
|
||||
@@ -441,22 +472,50 @@
|
||||
padding-bottom: env(safe-area-inset-bottom, 0px);
|
||||
|
||||
& ul {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: 4rem;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
& li {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-nav-link {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.25rem;
|
||||
padding-block: 0.5rem;
|
||||
margin-inline: 0.25rem;
|
||||
min-height: 56px;
|
||||
border-radius: var(--t-radius-card, 0.5rem);
|
||||
font-size: var(--t-text-caption);
|
||||
color: var(--t-text-secondary);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
background-color: transparent;
|
||||
|
||||
& svg {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
}
|
||||
|
||||
&[aria-current="page"] {
|
||||
color: hsl(var(--t-accent-h) var(--t-accent-s) calc(var(--t-accent-l) - 15%));
|
||||
font-weight: 600;
|
||||
background-color: hsl(var(--t-accent-h) var(--t-accent-s) var(--t-accent-l) / 0.1);
|
||||
|
||||
& svg {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,6 +532,9 @@
|
||||
}
|
||||
|
||||
.search-panel {
|
||||
width: 100%;
|
||||
max-width: 36rem;
|
||||
margin-inline: 1rem;
|
||||
background: var(--t-surface-raised);
|
||||
border-radius: var(--t-radius-card);
|
||||
overflow: hidden;
|
||||
@@ -480,39 +542,79 @@
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 1rem;
|
||||
border-bottom: 1px solid var(--t-border-default);
|
||||
}
|
||||
|
||||
.search-icon {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
flex-shrink: 0;
|
||||
color: var(--t-text-tertiary);
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
font-size: var(--t-text-large, 1.125rem);
|
||||
font-family: var(--t-font-body);
|
||||
color: var(--t-text-primary);
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.search-kbd {
|
||||
display: none;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
font-size: var(--t-text-caption);
|
||||
padding: 0.125rem 0.375rem;
|
||||
border-radius: var(--t-radius-button, 0.25rem);
|
||||
color: var(--t-text-tertiary);
|
||||
border: 1px solid var(--t-border-default);
|
||||
}
|
||||
|
||||
.search-close {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--t-text-tertiary);
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
border-radius: var(--t-radius-button);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
& svg {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.search-results {
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
|
||||
& ul {
|
||||
padding-block: 0.5rem;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
}
|
||||
|
||||
.search-result {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 0.75rem 1rem;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
transition: background-color 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
background: var(--t-surface-sunken);
|
||||
@@ -520,19 +622,47 @@
|
||||
}
|
||||
|
||||
.search-result-thumb {
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
flex-shrink: 0;
|
||||
border-radius: var(--t-radius-card, 0.25rem);
|
||||
overflow: hidden;
|
||||
background: var(--t-surface-sunken);
|
||||
|
||||
& img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.search-result-details {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.search-result-title {
|
||||
font-size: var(--t-text-small);
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: var(--t-text-primary);
|
||||
}
|
||||
|
||||
.search-result-meta {
|
||||
font-size: var(--t-text-caption);
|
||||
color: var(--t-text-tertiary);
|
||||
|
||||
& span {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.search-hint {
|
||||
padding: 1.5rem;
|
||||
color: var(--t-text-tertiary);
|
||||
font-size: var(--t-text-small);
|
||||
}
|
||||
|
||||
/* ── Shop footer ── */
|
||||
@@ -542,21 +672,65 @@
|
||||
border-top: 1px solid var(--t-border-default);
|
||||
}
|
||||
|
||||
.shop-footer-inner {
|
||||
max-width: 80rem;
|
||||
margin-inline: auto;
|
||||
padding: 3rem 1rem;
|
||||
}
|
||||
|
||||
.footer-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 3rem;
|
||||
}
|
||||
|
||||
.footer-links {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.footer-heading {
|
||||
font-family: var(--t-font-heading);
|
||||
font-weight: 600;
|
||||
font-size: var(--t-text-small);
|
||||
margin-bottom: 1rem;
|
||||
color: var(--t-text-primary);
|
||||
}
|
||||
|
||||
.footer-nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
font-size: var(--t-text-small);
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.footer-link {
|
||||
color: var(--t-text-secondary);
|
||||
cursor: pointer;
|
||||
transition: opacity 0.15s ease;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
.footer-bottom {
|
||||
margin-top: 3rem;
|
||||
padding-top: 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
border-top: 1px solid var(--t-border-subtle);
|
||||
}
|
||||
|
||||
.footer-copyright {
|
||||
font-size: var(--t-text-caption);
|
||||
color: var(--t-text-tertiary);
|
||||
}
|
||||
|
||||
@@ -1081,7 +1255,24 @@
|
||||
|
||||
/* ── Checkout success ── */
|
||||
|
||||
.checkout-main {
|
||||
max-width: 48rem;
|
||||
padding-block: 4rem;
|
||||
}
|
||||
|
||||
.checkout-header {
|
||||
text-align: center;
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.checkout-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
border-radius: 9999px;
|
||||
margin-bottom: 1.5rem;
|
||||
background-color: var(--t-accent);
|
||||
color: var(--t-accent-contrast);
|
||||
}
|
||||
@@ -1089,52 +1280,120 @@
|
||||
.checkout-heading {
|
||||
font-family: var(--t-font-heading);
|
||||
color: var(--t-text-primary);
|
||||
|
||||
&:where(h1) {
|
||||
font-size: var(--t-text-3xl, 1.875rem);
|
||||
font-weight: 700;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
&:where(h2) {
|
||||
font-size: var(--t-text-large, 1.125rem);
|
||||
font-weight: 600;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.checkout-meta {
|
||||
font-size: var(--t-text-large, 1.125rem);
|
||||
margin-bottom: 0.5rem;
|
||||
color: var(--t-text-secondary);
|
||||
|
||||
& strong {
|
||||
color: var(--t-text-primary);
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
font-size: var(--t-text-base, 1rem);
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.checkout-card {
|
||||
padding: 1.5rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.checkout-items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1.5rem;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
margin-top: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.checkout-item {
|
||||
border-color: var(--t-border-default);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid var(--t-border-default);
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.checkout-item-name {
|
||||
font-weight: 500;
|
||||
color: var(--t-text-primary);
|
||||
}
|
||||
|
||||
.checkout-item-detail {
|
||||
font-size: var(--t-text-small, 0.875rem);
|
||||
color: var(--t-text-secondary);
|
||||
}
|
||||
|
||||
.checkout-item-price {
|
||||
font-weight: 500;
|
||||
color: var(--t-text-primary);
|
||||
}
|
||||
|
||||
.checkout-total-border {
|
||||
border-color: var(--t-border-default);
|
||||
border-top: 1px solid var(--t-border-default);
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.checkout-total {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: var(--t-text-large, 1.125rem);
|
||||
color: var(--t-text-primary);
|
||||
}
|
||||
|
||||
.checkout-total-label {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.checkout-total-amount {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.checkout-shipping-address {
|
||||
color: var(--t-text-secondary);
|
||||
}
|
||||
|
||||
.checkout-actions {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.checkout-cta {
|
||||
padding: 0.75rem 2rem;
|
||||
}
|
||||
|
||||
.checkout-pending-icon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
border-radius: 9999px;
|
||||
margin-bottom: 1.5rem;
|
||||
background-color: var(--t-surface-sunken);
|
||||
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
||||
}
|
||||
|
||||
.checkout-pending-spinner {
|
||||
@@ -1142,34 +1401,140 @@
|
||||
}
|
||||
|
||||
.checkout-pending-text {
|
||||
font-size: var(--t-text-large, 1.125rem);
|
||||
margin-bottom: 2rem;
|
||||
color: var(--t-text-secondary);
|
||||
}
|
||||
|
||||
.checkout-pending-hint {
|
||||
font-size: var(--t-text-small, 0.875rem);
|
||||
color: var(--t-text-tertiary);
|
||||
}
|
||||
|
||||
.checkout-contact-link {
|
||||
text-decoration: underline;
|
||||
color: var(--t-accent);
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
50% { opacity: 0.5; }
|
||||
}
|
||||
|
||||
/* ── Error page ── */
|
||||
|
||||
.error-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: calc(100vh - 4rem);
|
||||
}
|
||||
|
||||
/* ── PDP variant fallback ── */
|
||||
.error-container {
|
||||
max-width: 42rem;
|
||||
padding-block: 4rem;
|
||||
}
|
||||
|
||||
/* ── PDP page ── */
|
||||
|
||||
.pdp-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 3rem;
|
||||
margin-bottom: 4rem;
|
||||
}
|
||||
|
||||
.pdp-variant-fallback {
|
||||
margin-bottom: 1.5rem;
|
||||
font-size: var(--t-text-small, 0.875rem);
|
||||
color: var(--t-text-secondary);
|
||||
}
|
||||
|
||||
/* ── Cart page list ── */
|
||||
/* ── Cart page ── */
|
||||
|
||||
.cart-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.cart-page-card {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.cart-page-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* ── Contact page ── */
|
||||
|
||||
.contact-main {
|
||||
max-width: 56rem;
|
||||
padding-top: 0;
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
|
||||
.contact-grid {
|
||||
display: grid;
|
||||
gap: 2rem;
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.contact-sidebar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
/* ── Content page image ── */
|
||||
|
||||
.content-hero-image {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
/* ── Screen reader only ── */
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
/* ── Responsive breakpoints ── */
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.page-container { padding-inline: 1.5rem; }
|
||||
.shop-header { padding: 0.75rem 1rem; }
|
||||
.shop-footer-inner { padding-inline: 1.5rem; }
|
||||
.search-kbd { display: flex; }
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.shop-container[data-bottom-nav] { padding-bottom: 0; }
|
||||
.shop-header { padding: 1rem 2rem; }
|
||||
.shop-nav { display: flex; gap: 1.5rem; }
|
||||
.mobile-bottom-nav { display: none; }
|
||||
.footer-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
.footer-bottom { flex-direction: row; }
|
||||
.pdp-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
.contact-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.page-container { padding-inline: 2rem; }
|
||||
.shop-footer-inner { padding-inline: 2rem; }
|
||||
.cart-grid { grid-template-columns: 2fr 1fr; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user