Skip to content

css compiler parsing too simplistic; confuses xxbackground-image with background-image #9884

@polyglotinc

Description

@polyglotinc

I have no idea where to put this bug report, so feel free to redirect it to the appropriate category.
Whatever AngularCLI uses to compile the app, the part that preprocesses css files seems to parse too simplistically, and doesnt recognize that someLegalCssProperty is not the same as xxsomeLegalCssProperty. I.E. I often "comment out" things in css by prepending xx and they happily get ignored. But, I have noticed that the angular compiler process doesnt always catch the difference.

For example, described below is where I just noticed that the "background-image" property (referring to Wallpaper.jpg) that I last year changed to "xxbackground-image", is still resulting in Wallpaper.e9546829eb43e9d5577f.jpg being generated and put in the home directory of my production build dist folder.

Versions

Angular 4 and 5 (at least)

Repro steps

Put the following into a css file used by your Angular app,
and put an example image into your assets folder (so your app will compile via cli)

body {
    xxbackground-image: url("../../assets/example.jpg");
}

Observed behavior

The example image file (renamed with hash info) appears in the top level directory of your compiled dist folder.

Desired behavior

There should be no image file placed into dist folder because thats not a background-image directive that css would pay attention to.

Extra Info

BTW, when I actually deleted the xxbackground-image line from my css file, the image file stopped being generated into my home folder, so, I know that it was that line that was being processed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions