Post

Although it’s not a core task of my role as Chrome DevRel, I took the time to build something that I needed into DevTools: debugging support for CSS `@starting-style` rules. The feature is ready for testing in Chrome Canary.

9 reposts145 likes

Be sure to let me know how it’s working for you, and whether the design decisions I made actually make sense or not :)

Yo, can we get a element picker/inspect mode/selector picker web helper function like elementPicker() so we could code that into snippets? Like, it would do Ctrl Shift C, wait until an element is selected, and then return $0 (the selected element)

1. I expect **correctness** from DevTools, and have it show only what you are actively seeing on the screen. When inspecting a square in codepen.io/bramus/pen/M..., we don’t show the `@starting-style { background-color: yellow }` rule by default because that doesn't match the state on the page.

2. To easily **discover** elements that are affected by a `@starting-style` rule, a new pill is shown next in the elements tree. We chose using this adorner over tucking it away in the `:hov` panel, because that one is collapsed by default.

3. To allow you to **inspect and edit** these `@starting-style`s, you can click the pill to force the element into its `@starting-style`-state. The element will be painted with its `@starting-style` rules applied, and DevTools will therefore also shows those style rules.