CSS Reference Guide for AI Generation
Quick Copy-Paste Patterns
.button {
padding : 12px 32px ;
background : linear-gradient (135deg , # 667eea 0% , # 764ba2 100% );
color : white;
border : none;
border-radius : 8px ;
font-weight : 600 ;
font-size : 16px ;
cursor : pointer;
transition : all 0.3s cubic-bezier (0.4 , 0 , 0.2 , 1 );
box-shadow : 0 4px 15px rgba (102 , 126 , 234 , 0.4 );
}
.button : hover {
transform : translateY (-2px );
box-shadow : 0 8px 25px rgba (102 , 126 , 234 , 0.6 );
}
.button : active {
transform : translateY (0 );
}
.glass-card {
background : rgba (255 , 255 , 255 , 0.1 );
backdrop-filter : blur (10px );
border : 1px solid rgba (255 , 255 , 255 , 0.2 );
border-radius : 16px ;
padding : 32px ;
box-shadow : 0 8px 32px rgba (0 , 0 , 0 , 0.1 );
}
.hero {
min-height : 100vh ;
display : flex;
align-items : center;
justify-content : center;
background : linear-gradient (135deg , # 667eea 0% , # 764ba2 100% );
color : white;
text-align : center;
padding : 80px 24px ;
}
.hero h1 {
font-size : clamp (2.5rem , 5vw , 4rem );
font-weight : 700 ;
margin-bottom : 24px ;
line-height : 1.2 ;
}
.hero p {
font-size : clamp (1.125rem , 2vw , 1.5rem );
opacity : 0.9 ;
max-width : 600px ;
margin : 0 auto 32px ;
}
.grid {
display : grid;
grid-template-columns : repeat (auto-fit, minmax (300px , 1fr ));
gap : 32px ;
padding : 80px 24px ;
max-width : 1200px ;
margin : 0 auto;
}
.card {
background : white;
border-radius : 16px ;
padding : 32px ;
box-shadow : 0 4px 20px rgba (0 , 0 , 0 , 0.08 );
transition : all 0.3s ease;
}
.card : hover {
transform : translateY (-4px );
box-shadow : 0 12px 40px rgba (0 , 0 , 0 , 0.15 );
}
.input {
width : 100% ;
padding : 12px 16px ;
font-size : 16px ;
border : 2px solid # E5E7EB ;
border-radius : 8px ;
transition : border-color 0.3s ;
background : white;
}
.input : focus {
outline : none;
border-color : # 6366F1 ;
box-shadow : 0 0 0 3px rgba (99 , 102 , 241 , 0.1 );
}
.navbar {
position : sticky;
top : 0 ;
background : rgba (255 , 255 , 255 , 0.9 );
backdrop-filter : blur (10px );
border-bottom : 1px solid rgba (0 , 0 , 0 , 0.05 );
padding : 16px 24px ;
display : flex;
justify-content : space-between;
align-items : center;
z-index : 100 ;
}
: root {
--primary : # 667eea ;
--secondary : # 764ba2 ;
--accent : # f093fb ;
--bg : # fafafa ;
--text : # 1a202c ;
}
: root {
--primary : # 4F46E5 ;
--secondary : # 06B6D4 ;
--accent : # EC4899 ;
--bg : # F9FAFB ;
--text : # 1F2937 ;
}
: root {
--primary : # 10B981 ;
--secondary : # 059669 ;
--accent : # 34D399 ;
--bg : # F0FDF4 ;
--text : # 064E3B ;
}
@keyframes fadeIn {
from {
opacity : 0 ;
transform : translateY (20px );
}
to {
opacity : 1 ;
transform : translateY (0 );
}
}
.fade-in {
animation : fadeIn 0.6s ease-out;
}
@keyframes pulse {
0% , 100% {
opacity : 1 ;
}
50% {
opacity : 0.5 ;
}
}
.pulse {
animation : pulse 2s cubic-bezier (0.4 , 0 , 0.6 , 1 ) infinite;
}
@keyframes slideUp {
from {
opacity : 0 ;
transform : translateY (30px );
}
to {
opacity : 1 ;
transform : translateY (0 );
}
}
.slide-up {
animation : slideUp 0.5s ease-out;
}
/* Mobile First */
.container {
padding : 16px ;
}
/* Tablet */
@media (min-width : 768px ) {
.container {
padding : 24px ;
}
}
/* Desktop */
@media (min-width : 1024px ) {
.container {
padding : 32px ;
max-width : 1200px ;
margin : 0 auto;
}
}
/* Large Desktop */
@media (min-width : 1280px ) {
.container {
max-width : 1400px ;
}
}
Spacing Scale (8px system)
: root {
--space-1 : 8px ;
--space-2 : 16px ;
--space-3 : 24px ;
--space-4 : 32px ;
--space-5 : 40px ;
--space-6 : 48px ;
--space-8 : 64px ;
--space-10 : 80px ;
--space-12 : 96px ;
--space-16 : 128px ;
}
: root {
--text-xs : 0.75rem ; /* 12px */
--text-sm : 0.875rem ; /* 14px */
--text-base : 1rem ; /* 16px */
--text-lg : 1.125rem ; /* 18px */
--text-xl : 1.25rem ; /* 20px */
--text-2xl : 1.5rem ; /* 24px */
--text-3xl : 1.875rem ; /* 30px */
--text-4xl : 2.25rem ; /* 36px */
--text-5xl : 3rem ; /* 48px */
--text-6xl : 3.75rem ; /* 60px */
}
: root {
--shadow-sm : 0 1px 2px rgba (0 , 0 , 0 , 0.05 );
--shadow-base : 0 1px 3px rgba (0 , 0 , 0 , 0.1 ), 0 1px 2px rgba (0 , 0 , 0 , 0.06 );
--shadow-md : 0 4px 6px rgba (0 , 0 , 0 , 0.07 ), 0 2px 4px rgba (0 , 0 , 0 , 0.06 );
--shadow-lg : 0 10px 15px rgba (0 , 0 , 0 , 0.1 ), 0 4px 6px rgba (0 , 0 , 0 , 0.05 );
--shadow-xl : 0 20px 25px rgba (0 , 0 , 0 , 0.1 ), 0 10px 10px rgba (0 , 0 , 0 , 0.04 );
--shadow-2xl : 0 25px 50px rgba (0 , 0 , 0 , 0.15 );
}
* {
margin : 0 ;
padding : 0 ;
box-sizing : border-box;
}
html {
scroll-behavior : smooth;
}
body {
font-family : -apple-system, BlinkMacSystemFont, 'Segoe UI' , Roboto, 'Helvetica Neue' , Arial, sans-serif;
line-height : 1.6 ;
color : var (--text );
background : var (--bg );
-webkit-font-smoothing : antialiased;
-moz-osx-font-smoothing : grayscale;
}
img {
max-width : 100% ;
height : auto;
display : block;
}
button {
font-family : inherit;
cursor : pointer;
}
a {
color : inherit;
text-decoration : none;
}
::selection {
background : var (--primary );
color : white;
}
: focus-visible {
outline : 2px solid var (--primary );
outline-offset : 2px ;
}
@media (prefers-reduced-motion : reduce) {
* ,
* ::before ,
* ::after {
animation-duration : 0.01ms !important ;
animation-iteration-count : 1 !important ;
transition-duration : 0.01ms !important ;
}
}