Skip to content

Path declared in SCSS variable is incorrectly resolved #27007

Closed
@piozygmunt

Description

@piozygmunt

Command

build, serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

16

Description

There seems to be a problem with resolving a path in scss/css when it's declared in SCSS variable. I prepared a simple repo here: https://github.com/piozygmunt/angular-scss . The crucial part is here https://github.com/piozygmunt/angular-scss/blob/master/src/app/scss/utils.scss .utils.css is file that is being imported into app.component.scss. Relative path from utils.scss to angular.png is ../../angular.png and when it is directly used inside url() function, it works. However if i define SCSS variable with the same path-value I'm getting error (path can't be resolved), also when it is changed to path relative to app.component.scss (../angular.png) it works again.

Is the new behaviour intentional?

Minimal Reproduction

https://github.com/piozygmunt/angular-scss

Exception or Error

No response

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 17.1.0
Node: 18.19.0
Package Manager: npm 10.2.3
OS: linux x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1701.0
@angular-devkit/build-angular   17.1.0
@angular-devkit/core            17.1.0
@angular-devkit/schematics      17.1.0
@schematics/angular             17.1.0
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.3

Anything else relevant?

No response

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