Inspector Styles panel

Overview

The Styles panel adds tap-to-select element inspection and touch-friendly CSS editing to the Inspector. Tap an element in the live preview (or type a selector), then edit its inline styles as a plain list of property → value rows that write straight to the page — and read the result in a pinned, live element preview, without scrolling back to the Preview panel.

Usage

Open the Inspector tab, connect to a page, and turn on the Styles panel (its chip in the panel bar). Then:

  1. Tap to select — tap Tap element to enter pick mode, then tap anywhere on the live preview. While pick mode is on, the preview shows a Pick: tap an element in the page banner with a Cancel button, and the tapped surface is outlined in the accent colour with a crosshair cursor — so a tap that will select an element is never mistaken for a tap that pokes the page. The matching element is highlighted (CDP Overlay.highlightNode) and its label (div#hero.card), box-size, inline styles, and computed styles appear. The label and box size head the panel's own body (see Check the element), which is where the element's identity lives. Pick mode disarms itself after a successful pick; a tap that hits nothing selectable keeps it armed so you can try again, and Cancel (or the crosshair button in the Styles card header, which is the same toggle) turns it off without a trip back to the panel.

Alternatively, type a CSS selector (e.g. #hero .card) in the small field and tap Select. This works even when the preview is hidden.

  1. Check the element — the selected element's identity is the first row of the panel body: a full-width chip reading div#hero.card with its box size at the end, which taps to copy the selector (the desktop Styles pane's Copy selector) and reports the result in the status pill above the panels. The row it shares with nothing is why it is readable: the three card-wide actions (Clear, Refresh, Pick) used to be three labelled buttons on that same line, which at a 360 px width left the label answering what am I editing? about 100 px — so it ellipsized first. Those three moved up into the card header, next to the panel's own eye (see The actions are in the card header below), and the identity kept the row. The chip goes away when the selection is cleared. Under it sits the element preview (a clipped screenshot of the selected element), and it is pinned: the identity row is sticky, so it stays on screen while the property list below scrolls and an edit's result is readable in place. The preview is live: it follows the page on its own (a style typed into the page, a field filled from the Preview panel's type bar, an animation, the page's own script), so what it shows is what is on the page. It never blanks between captures: a new capture is written into the same <img> node, and a browser keeps an image's last painted bitmap up while a newly assigned src decodes — so selecting a different element goes straight from the old picture to the new one, instead of showing an empty strip for the ~250 ms a clipped capture and its decode take (longer on a real page). Tap the image to force a re-capture on demand; a caption under it reads Live element preview — tap to refresh and reports the capture's size.

  2. Walk the tree — the Element tree section opens with one line saying what it is for (Tap a chip to select that element — the highlighted chip is this one) and then has two labelled rows, so neither the direction of travel nor what a chip does is in doubt:

  1. Change it with touch controls — the Style controls section edits the element with chips, sliders and swatches instead of typed values: six group tabs (Layout, Spacing, Size, Text, Colour, Effects), segmented chips for the enumerated properties (display, align-items, justify-content, text-align, font-weight), sliders flanked by − / + steppers with a Fine / Coarse step switch and unit chips, a box model whose four margin and four padding edges are each tappable, and colour rows offering the colours this page already uses. It opens on Layout for a flex or grid container and on Spacing otherwise, shows only the controls that apply to the element (a Block element has no flex-direction row), and writes the element's own inline style — one write per gesture, one receipt entry. Every row's value is also a button into the editor below. See Inspector touch controls.

  2. Edit a property — tap any row in Declared styles, edit the property and value, then tap Apply. The change is written to the element's inline style (element.style.setProperty) and reflected immediately in the pinned preview. Apply keeps the sheet open so a value can be adjusted repeatedly; the close button reads Cancel until something has been applied, then Done. Tap Remove to drop a property. A declaration the browser will not accept is named before you apply it, and Cancel on a field you have edited but not applied asks before discarding it.

A declared row opens with its current value already in the field, so an existing style is edited rather than retyped — tap the row, change what you need, Apply. The label reads Edit margin, value 40px.

  1. Raise the priority when a rule keeps winning — the sheet's Priority control sits under the value and reads normal or !important. A normal inline declaration does not beat a stylesheet rule marked !important; when the value you typed appears to do nothing, tap Priority until it reads !important and apply again. It opens on whatever the element already stores, so editing the value of an !important declaration keeps its priority. A declared row that is stored !important shows an !important badge next to the property name.

Removing a declaration that carried !important and then undoing that removal brings the priority back with the value — an undo never returns a declaration to the cascade in a weaker state than it was.

  1. Find what you changed — every property edited in this session is hoisted to the top of both lists (most recently changed first) and highlighted with an accent bar, tinted background, and a CHANGED chip. The value shown is re-read from the page after each edit, so the highlighted row is current. Picking a different element clears the highlight; Refresh on the same element keeps it.

  2. Nudge numbers — for a numeric value (24px, 1.5, 80%) the value field is flanked by − / + steppers that apply immediately, which is the fastest way to size something on a phone. The steppers are disabled for non-numeric values (colors, keywords, shorthands).

  3. Add a property — tap + Add property (the primary button under the controls) to open the property browser inside the panel, right under that button: search every property, narrow it by category (All / Layout / Spacing / Size / Type / Colour / Effects), or tap one of the suggested chips (color, background-color, font-size, margin, padding, border). Every card draws what the property does and reads Choose, or Edit with the value the element has now (its tooltip reads padding — set to 12px 8px). Picking a card closes the browser and opens the value editor on that property: a property the element declares opens with its current value, and the others open on the family's neutral value (0px for a length, 0 for a number, 0ms / 0deg for a time or an angle) so the type switch, the unit row and the rail are all present from the first tap — see Inspector value types. You can also type any property name in the editor's property field. Because the browser is a section of this card rather than a sheet over it, the element's pinned preview, its identity and the controls already set stay on screen while you choose — and + Add property closes it again.

  4. Refresh — the refresh button in the card header re-reads the element's styles after an external change; Computed shows the resolved values regardless of where they originate, so you can confirm an edit took effect even when a class or rule overrides it. It is disabled while a read is already in flight and while nothing is selected, so it never claims to have re-read something it did not.

  5. Narrow the computed list — the Computed section is every property the browser resolves (~400 rows). Type in the filter field to search property names and resolved values, then use the Show control — All / Declared / Changed — to switch between the complete read-out, only what this element declares in its own inline style, and only what you edited in this session. The Show label and the three chips are one control and wrap together: on a narrow screen they move to a second line as a unit, so the label is never left stranded at the right edge of the row above, pointing at nothing. Each chip names its meaning in its tooltip and accessible name, and the line under the search states the filter in force in words (Showing 12 of 406 · declared here, or 2 of 406 match “px” · all resolved when a search is on), so a small count is never mistaken for a broken read. Rows page in steps of 60, and a page never ends in the middle of a property family: if the 60th row is a background-* property, the page is extended past 60 to finish that family, so background-image is on screen beside background-color instead of being the first row of the hidden page. Scrolling to the end of the rendered list pages the next 60 in on its own, so reading down never dead-ends at a hard stop, and the Show N more button at the list's foot reveals the next step from anywhere (its label always counts what is still hidden — it is measured from the cut actually taken, not from the nominal 60; once everything is shown it reads Collapse to the first N, where N is that same extended cut).

  6. See where a value comes from — Matched rules lists every rule that matches the element (and every rule it inherits from an ancestor), most specific first, each with its selector, its @media condition when it has one, and a count of its declarations. Rules are collapsed to their header — tap one to open its declarations — and only the first (most specific, so usually the one being asked about) starts open. Tap a declaration to open the edit sheet pre-filled with that property and value, which copies it onto element.style so you can change it. The whole section is collapsed by default — the button reads Show rules, not a bare Show — and each rule card is marked with its origin, with browser-default rules carrying a browser chip rather than the DevTools abbreviation UA. Because a dozen of them per element bury the rule the user came for, they are filtered out of the list and the row under it offers them back in words: Show 5 browser default rules, which becomes Hide 5 browser default rules while they are on.

  7. Clear — the ✕ button in the card header clears the selection, the element chip, the pinned preview, the tree strips, and the page highlight. Switch the panel off and on again and the chip comes back, because the panel re-adopts the element the Inspector retained — only an explicit ✕ drops it.

Behavior

Readability

The panel stacks five sections of similar-looking rows in one scroller, and on a phone the difference between "a list I can read" and "a wall" comes down to a few things. They were measured on a card written as style="margin-top:20px;border:1px solid #ddd" at 390 × 844.

Density and scrolling

A 360 × 680 phone gives the Styles panel about 350 px of scroller, and every pixel of fixed chrome comes straight out of the property rows. This is what the panel spends its height on, measured on a real element — <main id="app-container"> on a page with 15 matched rules and 406 computed properties:

beforeafter
Total scroller content15 182 px (43 screens)2 634 px (7.5 screens)
Pinned block (identity + preview)139 px115 px
Computed row (read-only)44 px24 px
Declared row (interactive)44 px, of which only 18 px tappable44 px, fully tappable
Matched-rule declaration row53 px (wrapped)44 px
Style controls (one group)— (a chip row: 94 px)1 group at a time: 3-6 cards, each a chip row, a slider or the box model
Scroller, Styles as the only panel352 px488 px
Horizontal scrollers in the panel30

Requirements

The DOM and CSS CDP domains must be enabled against the inspected target. The Inspector enables both on connect; if either is unavailable the panel shows "no element" rather than failing. The pinned preview additionally needs Page.captureScreenshot (already required by the Preview panel).