Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Impossible to edit styles in Chrome?

Since I've implemented server side rendering and managing the styles with styled-components, Im unable to edit styles in Chrome Dev Tools. The styles in devtools become italic and theres no checkbox to turn off/on specified style.

enter image description here

It works properly in Mozilla. But why not in Chrome? Any ideas why does it happen? Thanks.

Note: It happens in production.

like image 574
Patrickkx Avatar asked Sep 30 '18 23:09

Patrickkx


People also ask

How do I add styles to Chrome?

Go to element panel ( Ctrl + Shift + p and type show element panel). Scroll to the head element right click on the element and choose Edit as HTML, go to the bottom of that element ( Ctrl + End ), add your <style></style> element there add your style in that element, and hit Ctrl + Enter .


2 Answers

I think you're probably seeing the styles injected via "speedy mode" in production. This uses a special DOM API that Chrome DevTools currently only shows in a read-only capacity. We haven't put in an escape hatch to disable this injection method yet, but it's being considered.

When running your setup in development mode everything should be normally inspectable and editable.

like image 124
probablyup Avatar answered Oct 17 '22 17:10

probablyup


You may also want to consider Firefox, it can edit such styles as usual

like image 6
xumix Avatar answered Oct 17 '22 16:10

xumix