Why copying styles ends being so messed up in devtools?

Viewed 91

Copied from Chrome Devtools

Ctrl+V in VS Code

Pasted in VS Code

Ctrl+C from Chrome Devtools

MY GUESS: It probably has to do with Chrome's new unit switching dropdown. So, is it really a bug. Or I'm doing something wrong.


I'm using svelte though. But I'm sure it doesn't have to do anything with the problem. I tried pasting in notepad too. Same result.

1 Answers

If you right click you can select "copy selector" to get

.event

and if you click "copy rule" you get

.event {
    position: absolute; //etc.
}

and if you click "copy all declarations" you get:

position: absolute; //etc.

enter image description here

Related