Directly Open The Inspector Stylesheet in Chrome

So you’ve added some styles to your page with Chrome’s dev tools. Awesome.

But when you click away from the element you’ve styled, the styles disappear from the sidebar! What if you were styling something that changes state, or left the DOM tempo…


This content originally appeared on Dave Ceddia and was authored by Dave Ceddia

So you’ve added some styles to your page with Chrome’s dev tools. Awesome.

But when you click away from the element you’ve styled, the styles disappear from the sidebar! What if you were styling something that changes state, or left the DOM temporarily? How can you add on to those existing styles?

Turns out that styles you add in the Elements tab are automatically added to the inspector-stylesheet, and there are a couple ways to bring it up.

This method works great if you can see the style in the Elements sidebar.

Click the gray inspector-stylesheet link next to the style that you’ve added.

Pointing out the inspector-stylesheet link in the sidebar

You can also create a new style (click the +) just for the sole purpose of getting the inspector-stylesheet link to appear, and then click the link.

In fact, this was the main way I got to the inspector stylesheet until I got fed up with that and decided to figure out where it is for real.

Inspector Stylesheet is in the Sources tab

The true home of the stylesheet is under the Sources tab. Open that up:

Pointing out the location of the Sources tab

From here, look for the current page’s domain name in the list on the left.

If you’re doing local development, this will probably be localhost.

When I do this for my published site, I see the site’s domain twice. The first one is the original content that came from the server, and the second contains the inspector-stylesheet. You might have to hunt around a bit.

Where to find the inspector-stylesheet file

I’m guessing that if you added styles inside an iframe, the inspector-stylesheet would be under that iframe’s domain. I haven’t verified this though.

Have fun inspecting styles!

Directly Open The Inspector Stylesheet in Chrome was originally published by Dave Ceddia at Dave Ceddia on October 23, 2020.


This content originally appeared on Dave Ceddia and was authored by Dave Ceddia


Print Share Comment Cite Upload Translate Updates
APA

Dave Ceddia | Sciencx (2020-10-23T16:34:27+00:00) Directly Open The Inspector Stylesheet in Chrome. Retrieved from https://www.scien.cx/2020/10/23/directly-open-the-inspector-stylesheet-in-chrome/

MLA
" » Directly Open The Inspector Stylesheet in Chrome." Dave Ceddia | Sciencx - Friday October 23, 2020, https://www.scien.cx/2020/10/23/directly-open-the-inspector-stylesheet-in-chrome/
HARVARD
Dave Ceddia | Sciencx Friday October 23, 2020 » Directly Open The Inspector Stylesheet in Chrome., viewed ,<https://www.scien.cx/2020/10/23/directly-open-the-inspector-stylesheet-in-chrome/>
VANCOUVER
Dave Ceddia | Sciencx - » Directly Open The Inspector Stylesheet in Chrome. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2020/10/23/directly-open-the-inspector-stylesheet-in-chrome/
CHICAGO
" » Directly Open The Inspector Stylesheet in Chrome." Dave Ceddia | Sciencx - Accessed . https://www.scien.cx/2020/10/23/directly-open-the-inspector-stylesheet-in-chrome/
IEEE
" » Directly Open The Inspector Stylesheet in Chrome." Dave Ceddia | Sciencx [Online]. Available: https://www.scien.cx/2020/10/23/directly-open-the-inspector-stylesheet-in-chrome/. [Accessed: ]
rf:citation
» Directly Open The Inspector Stylesheet in Chrome | Dave Ceddia | Sciencx | https://www.scien.cx/2020/10/23/directly-open-the-inspector-stylesheet-in-chrome/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.