Fastest way to add a new blank stylesheet in Chrome's inspector developer tool (“Inspector stylesheet”)

匆匆过客 提交于 2021-02-07 09:57:26

问题


Usually, when I want to test CSS modifications, live, in Chrome, I use:

  • Right click > Inspect

  • Use the bottom right pannel, and use the + button to add a new class, and then edit it there.

But I've noticed there's even a handier way: open an "Inspector stylesheet" that opens a blank CSS document, that can be edited, and modifications are displayed live:

Question: what's the easiest/fastest way to open such an "Inspector stylesheet" in Google Chrome?

(by fastest, I mean faster than Right click, Inspect, + add a new class, click on the little inspector stylesheet link, etc.)

I cannot find it in a menu of Chrome's console/developer tools. Is there a keyboard shortcut that would open such an "Inspector stylesheet"?


回答1:


I don't have one easy shortcut, but I can get you there a tiny bit faster:

  1. F12 to open DevTools.
  2. button at top of Styles-panel on Elements tab, to create inspector-stylesheet.
  3. Doubleclick to open.

Once inspector-stylesheet is created, and I close it or close DevTools, how to find it again?

  • If you've closed DevTools when the inspector-stylesheet was still open, just go to the Sources tab directly (in DevTools, topbar) and the inspector-stylesheet should still be open.
  • If you've closed the inspector-stylesheet itself, then, while on the Sources tab, press Ctrl+P and type "inspector-stylesheet", usually after "in..." you will already see the inspector-stylesheet at the top of the suggestion-list of available files.
    And it should also still be visible at the top of the Styles-panel on the Elements tab, where you first created it.


来源:https://stackoverflow.com/questions/49586990/fastest-way-to-add-a-new-blank-stylesheet-in-chromes-inspector-developer-tool

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!