Fix CSS cascade layer issue preventing Tailwind utilities from working
Wrap custom styles in @layer base and @layer components so Tailwind utility classes (mx-auto, text-center, mb-6, etc.) can properly override them per the CSS Cascade Layers spec. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
10d05736d3
commit
ec4702bf98
|
|
@ -33,6 +33,8 @@
|
|||
font-display: swap;
|
||||
}
|
||||
|
||||
/* Base reset & defaults — in @layer base so Tailwind utilities can override */
|
||||
@layer base {
|
||||
:root {
|
||||
--bg-cream: #faf8f5;
|
||||
--bg-dark: #1a1a1a;
|
||||
|
|
@ -64,13 +66,15 @@ body {
|
|||
line-height: 1.8;
|
||||
}
|
||||
|
||||
/* Typography */
|
||||
h1, h2, h3, h4 {
|
||||
font-family: var(--font-cormorant), 'Cormorant Garamond', Georgia, serif;
|
||||
font-weight: 300;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
}
|
||||
|
||||
/* Component styles — in @layer components so Tailwind utilities can override */
|
||||
@layer components {
|
||||
.font-sans-alt {
|
||||
font-family: var(--font-montserrat), 'Montserrat', sans-serif;
|
||||
}
|
||||
|
|
@ -251,31 +255,6 @@ h1, h2, h3, h4 {
|
|||
color: var(--text-light);
|
||||
}
|
||||
|
||||
/* Animations */
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateY(20px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
@keyframes fadeInUp {
|
||||
from { opacity: 0; transform: translateY(40px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.fade-in {
|
||||
animation: fadeIn 0.8s ease forwards;
|
||||
}
|
||||
|
||||
.fade-in-up {
|
||||
animation: fadeInUp 1s ease forwards;
|
||||
}
|
||||
|
||||
/* Staggered animations */
|
||||
.stagger-1 { animation-delay: 0.1s; }
|
||||
.stagger-2 { animation-delay: 0.2s; }
|
||||
.stagger-3 { animation-delay: 0.3s; }
|
||||
.stagger-4 { animation-delay: 0.4s; }
|
||||
|
||||
/* Quote styling */
|
||||
.quote-mark {
|
||||
font-size: 4rem;
|
||||
|
|
@ -320,3 +299,29 @@ h1, h2, h3, h4 {
|
|||
background: rgba(255, 255, 255, 0.08);
|
||||
border-color: var(--accent-gold);
|
||||
}
|
||||
}
|
||||
|
||||
/* Animations — keep unlayered so they always apply */
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateY(20px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
@keyframes fadeInUp {
|
||||
from { opacity: 0; transform: translateY(40px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.fade-in {
|
||||
animation: fadeIn 0.8s ease forwards;
|
||||
}
|
||||
|
||||
.fade-in-up {
|
||||
animation: fadeInUp 1s ease forwards;
|
||||
}
|
||||
|
||||
/* Staggered animations */
|
||||
.stagger-1 { animation-delay: 0.1s; }
|
||||
.stagger-2 { animation-delay: 0.2s; }
|
||||
.stagger-3 { animation-delay: 0.3s; }
|
||||
.stagger-4 { animation-delay: 0.4s; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue