The ultimate CSS inspection, analysis, and design system extraction tool.
A powerful Chrome extension that goes far beyond DevTools — hover, inspect, copy, analyze, audit, and export CSS like never before.
Chrome DevTools shows you CSS. CSS Sniffer understands it.
| Feature | DevTools | CSS Sniffer |
|---|---|---|
| Filter browser defaults, group by category | ❌ | ✅ |
| Pin up to 5 elements, diff side-by-side | ❌ | ✅ |
| Export as CSS, SCSS, Tailwind, React, Vue, Svelte | ❌ | ✅ |
| Design token extraction & inconsistency detection | ❌ | ✅ |
| Performance audit (unused CSS, expensive selectors) | ❌ | ✅ |
| Cross-element pattern detection | ❌ | ✅ |
| Cascade & specificity visualization | ❌ | ✅ |
- Hover to inspect — Real-time CSS extraction as you move your mouse
- Click to lock — Select any element and explore its full computed styles
- Live editing — Double-click any value to change it instantly on the page
- Undo/Redo — Full history of all CSS changes you make
- Box model visualization — Interactive margin/border/padding/content display
- DOM navigation — Use arrow keys to traverse parent/child/sibling elements
- Keyboard shortcuts —
Spaceto pin,Shiftto pause,Escto exit
- Color palette extraction — Scans entire page, groups colors by hue family
- Typography scanner — Identifies every font/size/weight combination in use
- CSS variables detection — Finds all custom properties across stylesheets
- WCAG contrast audit — Checks every text element for AA/AAA compliance
- Full design system extraction — Colors, spacing scale, typography scale, border radii, shadows
- Inconsistency detection — "You have 14 near-identical grays — here's a consolidated palette of 6"
- Smart consolidation — Clusters similar colors and suggests a clean palette
- Export as:
- CSS Custom Properties (
:root { --color-primary: ... }) - Tailwind CSS config (
module.exports = { theme: { extend: ... } }) - Figma Tokens JSON (compatible with Figma Tokens plugin)
- Style Dictionary format (Amazon's token framework)
- CSS Custom Properties (
- Performance score (0-100) — At-a-glance health of your CSS
- Unused CSS detection — Finds rules that don't match any element on the page
- Expensive selectors — Flags universal selectors, deep nesting, attribute selectors
- Layout thrashing — Warns about
transition: alland animating layout-triggering properties - Paint cost analysis — Identifies paint-heavy elements vs GPU-composited layers
- Every matching rule — See all CSS rules that apply to the selected element
- Specificity calculation —
[0,1,2]badges on every selector - Winner/loser display — Green "WIN" badge on the rule that takes effect, strikethroughs on overridden ones
!importanttracking — See exactly where!importantoverrides normal cascade
- Transition detection — Property, duration, timing function, delay
- Animation analysis — Name, keyframes, iteration count, direction, fill mode, play state
- Visual easing curves — SVG bezier curve visualization for every timing function
- @keyframes breakdown — Shows every keyframe stage with its properties
- Web Animations API — Also detects animations created via JavaScript
- Breakpoint discovery — Finds all
@mediabreakpoints used on the page - Per-element timeline — Shows how the selected element's styles change at each breakpoint
- Change annotations — "At 768px:
flex-directionchanges fromrowtocolumn" - Visual breakpoint bar — See all breakpoints mapped on a viewport width scale
- Style fingerprinting — Groups elements by visual similarity
- Duplicate detection — "12 buttons share identical styles"
- Near-duplicate detection — "These two groups are 85% similar, differing only in
color" - Savings estimate — Shows how many bytes of CSS could be saved
- Copy as shared class — One-click export of the common CSS
- Capture CSS snapshots — Save an element's full CSS state at any point
- Diff vs current — Come back later and see exactly what changed
- Compare any two snapshots — Side-by-side diff with added/removed/changed properties
- Session persistence — Snapshots survive page interactions within the session
- Automatic tracking — Every live-edit is recorded with timestamp
- Revert individual changes — Click "Revert" on any entry
- Export as CSS patch — Get a copy-paste ready diff of all your changes
- Session summary — Total edits, affected elements, time range
- React component — Generates a styled-component or inline-styles functional component
- Vue SFC — Full
<template>+<script setup>+<style scoped>single file component - Svelte component — Ready-to-use Svelte file with
<style>block - Plus existing: CSS, SCSS, Tailwind utility classes, styled-components, CodePen
- One-click HTML report — Beautiful, self-contained design system document
- Includes everything — Colors, typography, spacing, radii, shadows, accessibility audit
- Print-ready — Clean layout optimized for PDF export
- Share with designers — "Here's what's actually on the live site"
- Save style guide — Store your brand's design tokens in Chrome sync storage
- Cross-device sync — Style guide follows you across machines
- Deviation checking — Compare live page against your saved guide
- Severity levels — Errors (wrong color), warnings (close but not exact), info (off-scale spacing)
-
Clone this repository
git clone https://github.com/aymenhmaidiwastaken/Css-Sniffer.git
-
Open Chrome Extensions
- Navigate to
chrome://extensions/ - Enable Developer mode (toggle in top-right)
- Navigate to
-
Load the extension
- Click "Load unpacked"
- Select the
css-snifferfolder
-
Start inspecting
- Click the CSS Sniffer icon in your toolbar
- Or right-click any element → "Inspect CSS with CSS Sniffer"
A manifest.firefox.json is included for Firefox compatibility. Rename it to manifest.json and load as a temporary extension via about:debugging.
- Click the CSS Sniffer extension icon
- Hit "Start Inspecting"
- Hover over any element on the page — the side panel shows its CSS in real-time
- Click to lock the selection
- Explore the tabs to dig deeper
The interface is organized into 4 groups with 15 total tabs:
| Group | Tabs | Purpose |
|---|---|---|
| Inspect | Styles, Box, Cascade, Anim | Element-level CSS analysis |
| Analysis | Colors, Type, Vars, Tokens, Patterns | Page-wide design system analysis |
| Perf | Audit, Responsive | Performance and responsive behavior |
| Track | Diff, Snapshots, History, A11y | Comparison, tracking, accessibility |
| Key | Action |
|---|---|
Hover |
Preview element CSS |
Click |
Select and lock element |
Space |
Pin element (up to 5) |
Arrow Keys |
Navigate DOM tree |
Shift |
Pause/resume scanning |
Esc |
Stop inspector |
- Go to Analysis → Tokens
- Click "Extract Design Tokens"
- Review the consolidated palette, spacing scale, type scale
- Check the inconsistency warnings
- Click Export → choose your format (CSS vars, Tailwind, Figma, Style Dictionary)
- Optionally save as a Style Guide for team deviation checking
- Go to Perf → Audit
- Click "Run Performance Audit"
- Review your score (0-100) and the four audit sections:
- Unused CSS (percentage of dead rules)
- Expensive selectors (deep nesting, universal, attribute)
- Layout thrashing (animated layout properties)
- Paint cost (heavy filters, unoptimized fixed elements)
css-sniffer/
├── manifest.json # Chrome Manifest V3
├── manifest.firefox.json # Firefox-compatible manifest
│
├── background/
│ └── service-worker.js # Message routing, tab state, lazy module injection
│
├── content/
│ ├── content.js # Message handler orchestrator
│ ├── content.css # Overlay and highlight styles
│ ├── utils/
│ │ ├── dom-helpers.js # Selector generation, element info
│ │ ├── css-filters.js # Default filtering, categorization, shorthands
│ │ └── keyboard.js # DOM navigation keyboard handler
│ └── modules/
│ ├── inspector.js # Hover/click/lock detection
│ ├── overlay.js # Visual highlights, floating CSS card
│ ├── css-extractor.js # Computed style extraction + box model
│ ├── pin-manager.js # Multi-element pinning with badges
│ ├── css-editor.js # Live CSS editing with undo/redo
│ ├── color-palette.js # Page color extraction + hue grouping
│ ├── typography.js # Font/size/weight analysis
│ ├── variables.js # CSS custom property detection
│ ├── contrast.js # WCAG contrast ratio checker
│ ├── diff.js # Side-by-side CSS comparison
│ ├── style-history.js # Edit changelog tracking
│ ├── design-tokens.js # Full design system extraction (lazy)
│ ├── perf-analyzer.js # CSS performance audit (lazy)
│ ├── pattern-detector.js # Cross-element pattern finding (lazy)
│ ├── responsive-inspector.js # @media breakpoint analysis (lazy)
│ ├── animation-inspector.js # Transition/animation detection (lazy)
│ ├── cascade-visualizer.js # Specificity & cascade (lazy)
│ └── snapshot-manager.js # Visual regression snapshots (lazy)
│
├── sidepanel/
│ ├── sidepanel.html # Main UI with 15 tab panes
│ ├── sidepanel.js # Message handling, rendering, exports
│ ├── sidepanel.css # Complete UI styling
│ ├── tab-manager.js # Two-tier grouped tab navigation
│ └── tabs/
│ ├── tab-tokens.js # Design token renderer
│ ├── tab-perf.js # Performance audit renderer
│ ├── tab-patterns.js # Pattern detection renderer
│ ├── tab-responsive.js # Responsive breakpoint renderer
│ ├── tab-animation.js # Animation inspector renderer
│ ├── tab-cascade.js # Cascade visualizer renderer
│ ├── tab-snapshots.js # Snapshot manager renderer
│ └── tab-history.js # Style history renderer
│
├── popup/
│ ├── popup.html # Quick launcher
│ ├── popup.js # Toggle inspector, open side panel
│ └── popup.css # Popup styling
│
├── lib/
│ ├── storage.js # Chrome storage wrapper
│ ├── theme.js # Dark/light mode management
│ ├── messaging.js # Message abstraction
│ ├── browser-polyfill.js # Firefox/Edge compatibility shim
│ ├── team-sync.js # Style guide save/load/check
│ └── exporters/
│ ├── css-exporter.js
│ ├── scss-exporter.js
│ ├── tailwind-exporter.js
│ ├── styled-exporter.js
│ ├── codepen-exporter.js
│ ├── react-exporter.js # React component generation
│ ├── vue-exporter.js # Vue SFC generation
│ ├── svelte-exporter.js # Svelte component generation
│ ├── figma-tokens-exporter.js # Figma Tokens JSON
│ ├── style-dictionary-exporter.js # Style Dictionary format
│ └── report-generator.js # HTML design report
│
├── styles/
│ └── variables.css # Global CSS variables (light + dark themes)
│
└── icons/
├── icon-16.png
├── icon-32.png
├── icon-48.png
└── icon-128.png
- Zero dependencies — Pure vanilla JavaScript, no frameworks, no build tools
- Lazy module loading — Heavy analysis modules (tokens, perf, patterns, etc.) are injected on-demand via
chrome.scripting.executeScript, not loaded on every page visit - Two-tier tab navigation — 15 tabs organized into 4 semantic groups to prevent tab overflow
- Content script ↔ Side panel messaging — Messages flow through the background service worker as a relay
- Dark mode — Full theme support with CSS custom properties and system preference detection
| Format | Use Case |
|---|---|
| CSS | Copy computed styles as a CSS rule |
| SCSS | Nested syntax with color variables |
| Tailwind CSS | Utility class string |
| styled-components | React styled.div template literal |
| React Component | Full functional component with styled-components |
| Vue SFC | <template> + <script setup> + <style scoped> |
| Svelte Component | Svelte file with scoped styles |
| CodePen | Opens a new CodePen pen with the element's HTML + CSS |
| CSS Variables | Design tokens as :root custom properties |
| Tailwind Config | tailwind.config.js with extracted theme |
| Figma Tokens JSON | Compatible with Figma Tokens plugin |
| Style Dictionary | Amazon Style Dictionary format |
| HTML Report | Self-contained shareable design system report |
| CSS Patch | Diff of all live-edit changes |
| Browser | Status |
|---|---|
| Chrome 109+ | Full support (Manifest V3 + Side Panel API) |
| Edge 109+ | Full support (Chromium-based) |
| Firefox 109+ | Supported via manifest.firefox.json (sidebar instead of side panel) |
| Safari | Not yet supported |
No build step required — the extension runs directly from source.
# Clone
git clone https://github.com/aymenhmaidiwastaken/Css-Sniffer.git
cd css-sniffer
# Load in Chrome
# 1. Go to chrome://extensions/
# 2. Enable Developer mode
# 3. Click "Load unpacked" and select this directory- Edit any file and reload the extension (
Ctrl+Shift+Ron the extensions page) - Content script changes require a page refresh on the target page
- Side panel changes take effect immediately after reopening
- Create
content/modules/your-module.jswith a global object - Add the lazy injection in
background/service-worker.jsrelay list - Add a message handler in
content/content.js - Create a tab renderer in
sidepanel/tabs/tab-yourmodule.js - Register the tab in
sidepanel/tab-manager.js - Add the tab pane in
sidepanel/sidepanel.html
Contributions are welcome! Here are some areas where help is appreciated:
- Testing — Add Jest + Puppeteer for unit and E2E testing
- TypeScript migration — Improve reliability with static types
- Build pipeline — Vite/webpack for minification and tree-shaking
- Safari support — WebExtension API adaptation
- Accessibility — ARIA labels and semantic HTML in the side panel
- Localization — i18n support for multiple languages
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License — see the LICENSE file for details.
- Built with the Chrome Extensions Manifest V3 API
- Inspired by tools like CSSPeeper, WhatFont, and Chrome DevTools
- Color distance calculations based on Euclidean RGB distance
- WCAG contrast ratios follow W3C WCAG 2.1 guidelines