| name | postcss-plugins |
| description | PostCSS plugin ecosystem — Autoprefixer, cssnano, nesting, custom plugins, preset configuration. Use when working with postcss plugins. |
| domain | content |
| author | oyi77 |
| license | Apache-2.0 |
| subdomain | content-creation |
| tags | ["content-creation","digital-content","media","plugins","postcss"] |
| version | 1.0.0 |
Overview
PostCSS is a CSS transformation tool with a rich plugin ecosystem. Autoprefixer adds vendor prefixes, cssnano minifies, nesting enables CSS nesting, and custom plugins can transform CSS in any way.
Capabilities
- Autoprefixer for vendor prefix management
- cssnano for CSS minification and optimization
- CSS nesting support (native and polyfill)
- Custom PostCSS plugin development
- Preset-env for modern CSS features
- Source map support and watch mode
When to Use
Trigger phrases:
-
"postcss plugins"
-
"PostCSS plugin ecosystem — Autoprefixer, cssnano, nesting, custom plugins, prese"
-
Need vendor prefix automation
-
Want CSS minification as part of build pipeline
-
Using CSS nesting before browser support is universal
-
Building custom CSS transformation tools
-
Using modern CSS features with fallbacks
When NOT to Use
- Task is about content strategy, not creation (use strategy skills)
- Task is about content distribution (use distribution skills)
- You need to analyze content performance (use analytics skills)
- Task is about content moderation (use moderation tools)
- You don't have content guidelines
- Task requires domain expertise (consult experts)
Pseudo Code
The postcss-plugins workflow follows a standard pipeline pattern.
Core flow:
# postcss-plugins primary flow
input = prepare(raw_data)
result = process(input, config={autoprefixer, configuration, cssnano, custom, ecosystem})
validate(result)
deliver(result)
Error handling:
on error:
log(error_details)
retry_with_backoff(max=3)
if still_failing: alert_and_escalate()
Core Workflow
# postcss-plugins primary flow
input = prepare(raw_data)
result = process(input, config={autoprefixer, configuration, cssnano, custom, ecosystem})
validate(result)
deliver(result)
Error Handling
on error:
log(error_details)
retry_with_backoff(max=3)
if still_failing: alert_and_escalate()
Configuration
module.exports = {
plugins: {
"postcss-import": {},
"postcss-nesting": {},
"postcss-preset-env": {
stage: 2,
features: {
"nesting-rules": false,
},
},
autoprefixer: {},
cssnano: process.env.NODE_ENV === "production" ? {} : false,
},
}
Autoprefixer Config
> 0.5%
last 2 versions
not dead
not ie 11
Custom Plugin
module.exports = (opts = {}) => {
return {
postcssPlugin: "postcss-add-prefix",
Declaration(decl) {
if (decl.prop.startsWith("my-")) {
decl.prop = `--custom-${decl.prop.slice(3)}`
}
},
}
}
module.exports.postcss = true
CSS Nesting
.card {
background: white;
& .title {
font-size: 1.5rem;
&:hover {
color: blue;
}
}
@media (max-width: 768px) {
padding: 1rem;
}
}
.card { background: white; }
.card .title { font-size: 1.5rem; }
.card .title:hover { color: blue; }
@media (max-width: 768px) { .card { padding: 1rem; } }
preset-env Features
.card {
color: oklch(60% 0.2 250);
container-type: inline-size;
text-wrap: balance;
&:has(> img) { grid-template-columns: 1fr 2fr; }
}
Common Patterns
- Preset-env stages: Stage 0 (experimental) → Stage 3 (nearly stable)
- Plugin order: import → nesting → preset-env → autoprefixer → cssnano
- Conditional plugins:
cssnano: production ? {} : false to skip in dev
- Source maps:
map: { inline: false } in config
- Watch mode:
postcss src/**/*.css -o dist/ --watch --map
How to Use
- Define content goal (traffic, engagement, conversion, brand awareness)
- Research target audience pain points and search intent
- Generate content using appropriate AI tools
- Edit and humanize output for authenticity
- Optimize for target platform (SEO, hashtags, format)
- Schedule and distribute across channels
- Measure performance and iterate
Red Flags
- AI-generated content sounds robotic: Always run through humanizer before publishing
- Engagement dropping week-over-week: Content fatigue or algorithm change — vary formats
- Duplicate content across platforms: Adapt content per platform, don't just cross-post
- No content calendar: Sporadic posting kills audience retention
- Ignoring analytics: Content without measurement is just publishing, not marketing
Verification
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization | Reality |
|---|
| "Good enough content works" | Quality content drives engagement. Mediocre content gets ignored. |
| "I will optimize later" | SEO and distribution need optimization from the start. |
| "Templates are good enough" | Templates are a starting point. Custom content outperforms generic. |