Inspector value types

Overview

A CSS declaration's type is invisible in the panel: 14px, 14, 87.5%, 0.875rem and auto all read as “the value of padding”, yet they are not interchangeable — some are the same value written differently, some discard information, and some cannot be derived without a base size the inspector may not have. The edit sheet therefore carries an explicit value type switch and a unit control next to the value field, and both state their cost before they are tapped.

The value type switch and unit control in the edit sheet at 360 px

Usage

Tap any declared style row (or a quick-add chip) in the Styles panel to open the edit sheet, then type or edit the value. Below the Value label:

A property the element does not declare yet opens on its family's neutral value — 0px for a length, 0 for a number, 0ms for a time, 0deg for an angle — rather than on an empty field, so the type switch, the unit row and the rail are all there from the first tap. A colour, a keyword and a custom property have no neutral form worth inventing (#000000 is a choice, not an absence), so those fields stay empty and the page palette or the keyword chips are the input. Nothing is written to the page until Apply, and the seeded value is editable like any other.

  1. Value type — one segment per applicable type with the value it would write underneath:

  1. Unit — a chip row for the type in force (px / rem / em for a length, ms / s for a time, deg / turn / rad for an angle). Same value, different unit: 16px ⇄ 1rem with a 16 px root, 180ms ⇄ 0.18s, 0.5turn ⇄ 180deg. A unit whose base size is unknown is shown ticked-out (rem with no root size read yet) rather than computed from an assumed 16 px.

  2. The warning line — names the cost of the lossy forms: Number 16px becomes 16 — the unit is dropped; still undoable · Keyword discards 16px — the old value stays undoable. Forms that cannot be derived are listed with the reason instead of offering a guessed number: Percent: a percentage of font-size needs a base size the inspector does not read.

  3. Apply — commits the value that is in the field. The switch itself never writes, so a type change is one property and one undo entry, and the element's other declarations are untouched.

Behaviour