Chrome extension to copy CSS of an element without DevTools
Short answer: use Kernhue. Press Alt+Shift+K, click any element to pin it, then click Copy CSS. You get one clean rule with only the properties that differ from the browser’s defaults, margins, padding, borders, radius and gap collapsed into shorthands, and colors in the format you choose — HEX, RGB, HSL or OKLCH. No DevTools panel, no hunting through crossed-out rules.
How to copy an element’s CSS in two clicks
- Open the page and press Alt+Shift+K, or click the Kernhue icon.
- Hover the element. Kernhue outlines its margin, padding and content box and shows its size.
- Click to pin it. Press ↑ to move to the parent element if you landed on a child.
- In the CSS card, pick a color format and click Copy CSS.

What the copied CSS looks like
For a styled <button class="btn btn-primary">, Kernhue copies:
button.btn.btn-primary {
display: inline-flex;
padding: 10px 18px;
align-items: center;
gap: 8px;
font-family: Inter, sans-serif;
font-size: 15px;
font-weight: 600;
color: #ffffff;
background-color: #2563eb;
border-radius: 8px;
cursor: pointer;
}
- A selector you can paste. The rule is named after the element itself —
button.btn.btn-primary, or#idwhen the element has an id. - Only what matters. Kernhue compares the element with a blank element of the same tag and leaves out everything that is just the browser default.
- Shorthands, not long lists. Four margin, padding, border or radius values become one line;
row-gapandcolumn-gapbecomegap. - Your color format. Switch to OKLCH and the same rule reads
background-color: oklch(54.6% 0.215 262.9). - Flex and grid included. Alignment, gaps, template columns and item placement come along, so the layout survives the copy.
The same panel also shows the element’s font (the one actually rendering), its text and background colors with the WCAG contrast ratio, and its box values.
Other ways to copy CSS
| What you get | Source | |
|---|---|---|
| Chrome DevTools, Styles tab | Right-click a rule to copy a declaration, all declarations of that rule, or all declarations as JS — one stylesheet rule at a time | Chrome DevTools CSS reference |
| CSS Peeper | Point-and-click CSS inspection; the free plan has a basic inspector and 3 “smart inspections” per day, paid plans from $2.49/month billed yearly | csspeeper.com/pricing, checked 2026-10-06 |
| Kernhue | One clean rule from the element’s final styles, defaults removed, shorthands collapsed, colors in HEX/RGB/HSL/OKLCH; free with no daily limit | — |
More detail: Kernhue vs CSS Peeper · Hoverify alternative · ColorZilla vs Kernhue · Kernhue home
Works where you build
- Logged-in apps and staging sites — Kernhue reads the tab you have open, so there is nothing to share or upload.
- localhost and local HTML files — see localhost and file:// setup.
- Whole-page styles — the Tokens tab turns a page’s colors, type scale, spacing, radius and shadows into CSS variables or a Tailwind theme (export design tokens).
Questions
Which CSS properties does Kernhue copy?
Layout (display, position and offsets, z-index, float, box-sizing, min/max sizes, margin, padding, overflow), flexbox and grid (direction, wrap, alignment, gap, grow/shrink/basis, order, template columns and rows, placement), typography (font-family, size, weight, style, line-height, letter-spacing, text-align, text-transform, text-decoration-line, white-space, color) and visuals (background-color, background-image, borders, border-radius, box-shadow, opacity, transform, filter, backdrop-filter, transition, cursor). Only the ones that differ from the browser default for that tag are included.
Why is width and height not in the copied CSS?
On purpose. The browser reports width and height as fixed pixel values even when the original CSS used percentages, flex or auto sizing, so copying them usually breaks the layout you are rebuilding. min-width, max-width, min-height and max-height are copied when they are set.
Does it copy the original stylesheet rule?
It copies the element’s final, computed styles — what the browser actually applied after every rule, class and inherited value was resolved — so you get one self-contained rule. To see which stylesheet rule set a value, or to copy :hover states and media queries, use the DevTools Styles tab (Chrome DevTools CSS reference).
Can I copy the colors as OKLCH?
Yes. Switch the format above the CSS to HEX, RGB, HSL or OKLCH and every color in the rule is rewritten in that format (more on OKLCH).
Is it free?
Yes. Copying CSS is free with no daily limits. Pro ($3 / month, $19 / year or $39 once) only adds AI names for design tokens.
Try Kernhue
Kernhue is a font finder, color picker and CSS inspector for Chrome. Hover any text to see the font that is actually rendering, pick colors in HEX, RGB, HSL or OKLCH, copy clean CSS for any element, and export a page’s colors, type scale and spacing as CSS variables, Tailwind or design-token JSON.
Coming soon to the Chrome Web Store