Ultimate CSS expert skill with modern CSS features, layout systems (Flexbox, Grid), custom properties, animations, and comprehensive CSS-Tricks references
Ultimativer CSS-Experten-Skill mit umfassenden Referenzen von CSS-Tricks.com. Deckt moderne CSS-Features ab: Flexbox, Grid, Container Queries, Custom Properties, Animations, Responsive Design, und Performance-Optimierung. Ermöglicht präzise, aktuelle CSS-Entwicklung mit Best Practices.
Verwende diesen Skill wenn:
ALWAYS referenziere CSS-Tricks.com und MDN bei:
Primary Documentation Sources:
CSS-Tricks Guides: https://css-tricks.com
MDN Web Docs: https://developer.mozilla.org/en-US/docs/Web/CSS
Can I Use: https://caniuse.com
CSS Spec: https://www.w3.org/Style/CSS/
Analyze Requirements
Choose Layout System
Implement Solution
Validate
/* Container Properties */
.flex-container {
display: flex;
flex-direction: row | column;
justify-content: flex-start | center | space-between | space-around;
align-items: stretch | center | flex-start | flex-end;
flex-wrap: nowrap | wrap | wrap-reverse;
gap: 1rem;
}
/* Item Properties */
.flex-item {
flex: 1; /* flex-grow, flex-shrink, flex-basis */
flex-grow: 1;
flex-shrink: 1;
flex-basis: auto;
align-self: auto | center | flex-start | flex-end;
order: 0;
}
/* Container Properties */
.grid-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: auto 1fr auto;
gap: 1rem;
grid-auto-flow: row | column | dense;
}
/* Item Properties */
.grid-item {
grid-column: 1 / 3;
grid-row: 2 / 4;
/* or */
grid-area: header;
}
/* Responsive Grid */
.responsive-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1rem;
}
/* Define Variables */
:root {
--primary-color: #3b82f6;
--spacing-unit: 8px;
--font-size-base: 16px;
--border-radius: 8px;
}
/* Use Variables */
.button {
background: var(--primary-color);
padding: calc(var(--spacing-unit) * 2);
border-radius: var(--border-radius);
}
/* Dynamic Theming */
[data-theme="dark"] {
--primary-color: #60a5fa;
--bg-color: #1e293b;
--text-color: #f1f5f9;
}
/* Define Container */
.card-container {
container-name: card;
container-type: inline-size;
}
/* Query Container */
@container card (min-width: 400px) {
.card {
display: grid;
grid-template-columns: 150px 1fr;
}
}
/* Style Queries */
@container style(--theme: dark) {
.element {
background: #1e293b;
}
}
.holy-grail {
display: grid;
grid-template-areas:
"header header header"
"nav content aside"
"footer footer footer";
grid-template-columns: 200px 1fr 200px;
grid-template-rows: auto 1fr auto;
min-height: 100vh;
}
.header { grid-area: header; }
.nav { grid-area: nav; }
.content { grid-area: content; }
.aside { grid-area: aside; }
.footer { grid-area: footer; }
/* Flexbox Centering */
.flex-center {
display: flex;
justify-content: center;
align-items: center;
}
/* Grid Centering */
.grid-center {
display: grid;
place-items: center;
}
/* Absolute Centering */
.absolute-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
/* Fluid Typography */
:root {
--fluid-min-width: 320;
--fluid-max-width: 1200;
--fluid-min-size: 16;
--fluid-max-size: 24;
}
body {
font-size: clamp(
var(--fluid-min-size) * 1px,
calc(var(--fluid-min-size) * 1px + (var(--fluid-max-size) - var(--fluid-min-size)) * (100vw - var(--fluid-min-width) * 1px) / (var(--fluid-max-width) - var(--fluid-min-width))),
var(--fluid-max-size) * 1px
);
}
.button {
background: #3b82f6;
transition: all 0.3s ease-in-out;
}
.button:hover {
background: #2563eb;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-in {
animation: fadeInUp 0.6s ease-out;
}
/* With Animation Timing */
.stagger-animation {
animation: fadeInUp 0.6s ease-out;
animation-fill-mode: both;
animation-delay: calc(var(--index) * 0.1s);
}
/* Above-the-fold styles */
/* Inline this in <head> for faster initial render */
body {
margin: 0;
font-family: system-ui, -apple-system, sans-serif;
}
.hero {
min-height: 100vh;
display: grid;
place-items: center;
}
.card {
contain: layout style paint;
/* Isolates rendering context for better performance */
}
.animated-element {
will-change: transform, opacity;
/* Hints browser to optimize */
}
.animated-element.animating {
transform: translateX(100px);
opacity: 0.5;
}
CSS-Tricks (Primary Source):
MDN Web Docs:
Tools: