Skip to content

Editing CSS in the inspect menu is broken in Chromium browsers #24414

Closed
@emmettito

Description

@emmettito

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

To re-create this issue, perform the following steps:
Create a new project with "ng new demo"
When creating the project, make sure to enable SCSS

Create 2 components, each with its own unique SCSS file.
Create a mixin in the generated styles.scss.
Import styles.scss in both components and utilize the shared mixin in both.
Include both components in the generated app component template.

Run "ng serve".

In Google Chrome, or any other Chromium-based browser open up to http://localhost:4200/

Right-click and inspect one of the components. In the Styles tab, edit one of the styles. The styles of the other component will have become corrupted and cannot be undone until the page is refreshed.

For this demo, I have 3 instances of Component A and 3 instances of Component B.
I inspected the last instance of Component B.
image

I changed the background from lightgreen to darkgreen and the styles for Component A no longer apply.
image

I changed the color back to lightgreen and styles for Component A are still in a broken state.
image

Please provide a link to a minimal reproduction of the bug

https://www.icloud.com/iclouddrive/029Z8W6H1o12qpP8GR4bJ6m4g#demo

Please provide the exception or error you saw

Please see the screenshots included above.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 15.0.3
Node: 16.17.0
Package Manager: npm 8.18.0
OS: win32 x64

Angular: 15.0.3
... animations, cli, common, compiler, compiler-cli, core, forms     
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1500.3
@angular-devkit/build-angular   15.0.3
@angular-devkit/core            15.0.3
@angular-devkit/schematics      15.0.3
@schematics/angular             15.0.3
rxjs                            7.5.7
typescript                      4.8.4

Anything else?

The issue exists in any Chromium-based browser, but does not exist in Firefox or Safari.

The issue only exists when running on localhost using the command "ng serve". It does not exist when you run "ng build" and serve the files separately.

I've personally tested this on the latest iterations of macOS and Windows 11 and the issue exists in both Operating Systems.

The issue did not appear in Angular 14, but appeared when we upgraded our projects to Angular 15 and could no longer edit the CSS in the browser during development.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions