| name | compliance-w3c-wsg |
| description | Ensures sustainable web design and minimizes environmental impact (W3C guidelines) |
| category | Sustainability & Environment |
| keywords | W3C, sustainability, green web, energy efficiency, carbon footprint, performance, accessibility |
| license | MIT |
SKILL: W3C Web Sustainability Guidelines
📖 What are the W3C Sustainability Guidelines?
W3C Web Sustainability Guidelines (WSG)
- Standard: W3C Web Sustainability Guidelines 1.0
- Scope: Practical guidance for sustainable web design across all web products
- Impact: Reduces carbon footprint, energy consumption, server load, network traffic
- Version: 1.0 (published 2024)
- Reference: https://www.w3.org/TR/2024/WD-sustyweb-1-20240429/
🎯 Key Principles
- Perception of Performance — Users perceive speed faster than actual performance
- Energy & Emissions — Minimize electricity consumption and carbon footprint
- Network — Reduce data transfer and network requests
- Alignment — Ensure alignment with user needs and availability
- Measurement — Monitor and optimize environmental impact
- Materials & Waste — Design for hardware longevity and digital waste reduction
- Hardware Life Extension — Support older devices and slow networks
- Culturally Appropriate Design — Adapt to local contexts and connectivity
- Inclusive Design — Accessibility + sustainability = better for all
- Unkillable Design — Resilient, works offline, graceful degradation
- Monitoring & Management — Track sustainability metrics over time
✅ Implementation Checklist
Perception of Performance
import { Suspense } from 'react'
const Dashboard = () => (
<Suspense fallback={<SkeletonLoader />}>
<HeavyDataComponent />
</Suspense>
)
<picture>
<source srcSet="image-small.webp" media="(max-width: 480px)" />
<source srcSet="image-medium.webp" media="(max-width: 1024px)" />
<source srcSet="image-large.webp" />
<img src="image-fallback.jpg" loading="lazy" alt="..." />
</picture>
const AdminDashboard = lazy(() => import('./admin/dashboard'))
const UserProfile = lazy(() => import('./user/profile'))
Energy & Emissions
const allItems = await repository.find()
const items = await repository.find({
skip: (page - 1) * pageSize,
take: pageSize,
})
app.use(compression({ level: 6 }))
const cachedData = await cache.get('expensive-calc')
if (!cachedData) {
const result = expensiveCalculation()
await cache.set('expensive-calc', result, 3600)
}
Network
select: '*'
select: ['id', 'name', 'email']
<picture>
<source srcSet="image.avif" type="image/avif" />
<source srcSet="image.webp" type="image/webp" />
<img src="image.jpg" alt="..." sizes="(max-width: 480px) 100vw, 50vw" />
</picture>
@font-face {
font-family: 'Efficient';
src: url('font-subset.woff2') format('woff2');
font-display: swap;
}
Alignment
;<form action="/api/submit" method="POST" noValidate>
<input name="email" type="email" required />
<button type="submit">Subscribe</button>
</form>
form.addEventListener('submit', (e) => {
e.preventDefault()
fetch('/api/submit', { method: 'POST', body: new FormData(form) })
})
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js')
}
Measurement
import { getMetrics } from 'web-vitals'
getMetrics((metric) => {
console.log(`${metric.name}: ${metric.value}`)
fetch('/api/metrics', {
method: 'POST',
body: JSON.stringify({
name: metric.name,
value: metric.value,
timestamp: new Date(),
}),
})
})
const carbonFootprint = await fetch('https://api.websustainability.org/carbon', {
body: JSON.stringify({ pageSize, requests, energy }),
}).then((r) => r.json())
Materials & Waste
const supportsWebP = () => {
const canvas = document.createElement('canvas')
return canvas.toDataURL('image/webp').indexOf('webp') === 5
}
const imageFormat = supportsWebP() ? 'webp' : 'jpg'
@supports (display: grid) {
.container {
display: grid
grid-template-columns: repeat(3, 1fr)
}
}
@supports not (display: grid) {
.container {
display: flex
flex-wrap: wrap
}
}
Hardware Life Extension
if (navigator.deviceMemory < 4) {
document.body.classList.add('low-memory')
}
if (window.matchMedia('(prefers-contrast: more)').matches) {
}
animation: slide 0.3s ease-in-out
@keyframes slide {
from { transform: translateX(0) }
to { transform: translateX(100px) }
}
Culturally Appropriate Design
const img = new Image()
img.src = 'large-image.jpg'
img.style.loadingStrategy = 'lazy'
if (navigator.connection?.effectiveType === '4g') {
loadHighResAssets()
} else {
loadCompressedAssets()
}
const formatter = new Intl.NumberFormat(userLocale, {
style: 'currency',
currency: userCurrency,
})
Inclusive Design
Unkillable Design
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open('v1').then((cache) => {
return cache.addAll(['/', '/styles.css', '/offline.html'])
})
)
})
self.addEventListener('fetch', (event) => {
event.respondWith(
caches.match(event.request).then((response) => {
return response || fetch(event.request)
})
)
})
Monitoring & Management
🔗 Relationship with Other Standards
| Standard | Overlap | Distinction |
|---|
| RGESN | ~80% overlap | WSG more detailed, RGESN more French-specific |
| WCAG | ~40% (accessibility = sustainability) | WSG broader (energy, emissions, hardware) |
| RGI | ~20% (API efficiency) | WSG focused on user-facing sustainability |
| Performance | ~60% (perf = lower energy) | WSG adds carbon/emissions tracking |
📚 Common Pitfalls
| Pitfall | Problem | Solution |
|---|
| Ignoring slow networks | 40% of users on slow connections | Test on 3G/4G, mobile devices |
| Large images | 50% of page weight often images | Optimize: WebP, AVIF, responsive srcset |
| Heavy JS framework | Modern frameworks 300KB+ | Use lightweight alternatives, code splitting |
| No caching | Repeated downloads waste energy | Implement server + client-side caching |
| Bundling all code | Users download unused JS | Code splitting, tree-shaking, lazy loading |
| No offline support | App breaks without connection | Service workers, offline-first design |
| Autoplaying videos | Drains battery, wastes data | Play on user interaction, not autoplay |
| Font loading blocks render | Font requests block page display | Use font-display: swap, system fonts |
🛠️ Tools & Resources
📖 Summary
The W3C Web Sustainability Guidelines provide a holistic framework for building web applications that:
- ✅ Perform well (perceived + actual)
- ✅ Use less energy and produce less carbon
- ✅ Minimize network transmission
- ✅ Support older devices and slow networks
- ✅ Are accessible and inclusive
- ✅ Work offline and degrade gracefully
- ✅ Are measured and continuously optimized
By following these guidelines, teams build applications that are better for users, better for the environment, and better for society.