Lost your DevTools CSS changes on reload? Keep them and ship them

Every CSS tweak in DevTools disappears on refresh. The built-in ways to keep them, why they are fiddly, and a faster path from a change in the browser to a change in your code, or your coding agent.

By Swapnil Gupta · · 6 min read

Twenty minutes of nudging padding and colours in DevTools, the page finally looks right, and then a reload, a hot-module refresh or a closed tab wipes it all. You remember some of it. You retype it into the code and it is not quite the same. This guide is about not losing that work, and about getting it from the browser into the code with nothing retyped.

Why your changes vanish#

DevTools edits the page's styles in memory. The files on the server are untouched, so the next load fetches them again and your edits are gone. This has been a complaint for as long as DevTools has existed; a Firefox bug asking to recover edits after an accidental reload has been open for over a decade.

The built-in ways to keep them#

Local Overrides (Chrome and Edge). DevTools saves a copy of each file you edit to a folder on your machine and serves that copy instead of the real one, so edits survive a reload.

  1. Open Sources, then the Overrides tab, and choose Select folder for overrides.
  2. Allow DevTools access to the folder.
  3. Edit styles as usual; changed files get a purple dot and are kept across reloads.

Workspaces. Map the site to your project folder, and DevTools writes edits straight into your source files. Recent Chrome versions can connect a local dev server's folder for you.

Both work, with catches:

  • Overrides are copies. You still have to move the changes into your project by hand.
  • Workspaces need the served file to map to a source file. With a bundler, CSS-in-JS or Tailwind, the CSS the browser sees is generated, and there is nothing to write back to.
  • Neither works on a site you do not have the source for, like staging or production.

Getting a list of what you changed#

Before keeping changes, you need to know what they are. Chrome's Changes tab (open it from the Command Menu with Ctrl+Shift+P or ⌘⇧P, then "Show Changes") lists every edit as a diff of each stylesheet. Firefox has a Changes panel in the Inspector. They are good for reading, but they are diffs of generated files: a change to a Tailwind class or a style from a CSS-in-JS library shows up as a change to a file no one edits.

From the browser to your code#

What you actually want is the change written the way your code is written. That is what Nitpique's Live edit is built around. Press L, click an element and change its spacing, colours, type or any CSS property, and every edit goes into a list of Changes, with its selector and its old and new value.

Three edits made on the page, each with its selector and its old and new value, ready to copy in the form your code uses.
  • Your changes survive a reload. They are saved for the page in your browser and put back when you turn Nitpique on there again.
  • Copy them as CSS, or copy an element's styles as Tailwind classes or JSX.
  • Copy them as a prompt for your coding agent. Choose Prompt in Changes, and every change is written up with its selector, file and what to do, ready to paste into Claude Code, Cursor or Copilot, which finds the right component and makes the edit in your source.
Make these style changes in the codebase:

1. .card: padding 16px → 24px
2. .btn-primary: background #3b82f6 → #2563eb
3. h2.title: margin-top 32px → 24px

The prompt above is a shortened example of the idea; the real one also names the file each style comes from, where the page reveals it.

Habits that save the work#

  • Turn off hot reload while you experiment, or edit in a tab that is not watching files.
  • Copy the change list before you close the tab, every time, even if it is short.
  • Change tokens, not values, when you can: a fix to --space-4 fixes every use.
  • Check the change at a phone width before you take it to the code.
Editing a live production page is safe: changes only ever happen in your own browser tab. That makes it the best place to try a fix with real content and real data before anyone writes code.

Read next