Directly Open The Inspector Stylesheet in Chrome
source link: https://daveceddia.com/inspector-stylesheet-chrome/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
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.
Click the inspector-stylesheet
link beside the style
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.
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:
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.
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!
Want to get better at React?
I send an article every Wednesday to help you level up as a front-end React developer. Drop your email in the box if you'd like to get on the list.
Learning React can be a struggle — so many libraries and tools!
My advice? Ignore all of them :)
For a step-by-step approach, check out my Pure React workshop.
Learn to think in React
- 90+ screencast lessons
- Full transcripts and closed captions
- All the code from the lessons
- Developer interviews
Dave Ceddia’s Pure React is a work of enormous clarity and depth. Hats off. I'm a React trainer in London and would thoroughly recommend this to all front end devs wanting to upskill or consolidate.
Recommend
-
49
Challenger Deep Theme
-
20
前言:某些原因,想直接使用go编译生成的可执行文件+前端编译好的静态文件,直接布置项目,不用依赖于nginx。 想看结果的同学直接拉到最下面看代码和总结 开始探索: 首先想到的是golang路由中指向静态资...
-
8
.usa-stars {Show CSS} .usa-stars { background: linear-gradient(324deg, #3c3b6e 4%, transparent 4%) -0.7in 0.43in, linear-gradient(36deg, #3c3b6e 4%, transparent 4%) 0.3in 0.43in...
-
7
Textretty A simple typography stylesheet used on HTML page. Introduction Textretty is a simple typography stylesheet which can be used on any html-based document. It's usually for article content...
-
7
SASS is often preferred as critically important stylesheet for styling webpage Reading Time: 2 minutes
-
0
Dark Mode Stylesheet — Hi, I’m Sam Dark Mode Stylesheet — Hi, I’m Sam Hi, I’m Sam This is my blog. I also have a website thing....
-
6
Minimalist stylesheet for HTML elements A minimalist stylesheet for HTML elements No class names, no frameworks, just semantic HTML and you're done.
-
6
JavaFX-Dark-Theme A complete CSS stylesheet to set a dark theme in your JavaFX UI....
-
6
Removing A CSS Stylesheet Removes Its Affect On The Document By Ben Nadel on April 6, 2023 When you load a Ja...
-
3
Using A Transient CSS Stylesheet To Remove Scrolling On Body While Modal Is Open By Ben Nadel on April 7, 2023
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK