Skip to content

Imported local aliases not working when used in selectors #561

@apexskier

Description

@apexskier

Reporting css-modules/icss#12 for visibility. I'll copy the details, but I'm experiencing the exact same issue.

Do you want to request a feature or report a bug?
bug report

What is the current behavior?

// foo.scss
.foo {
    color: blue;
}

// bar.css
:import("foo.css") {
    fooClassName: foo;
}
.fooClassName .bar { // <-- this doesn't get replaced :(
    color: red;
}

// baz.css
:import("foo.css") {
    fooClassName: foo;
}
.baz {
    color: fooClassName; // <-- this does get replaced :)
}

What is the expected behavior?
fooClassName is replaced with the local name for foo from foo.css in both bar.scss and `baz.scss

Please mention other relevant information such as your webpack version, Node.js version and Operating System.
I'm currently testing with webpack 2.2.1, node 7.2.1, css-loader 0.28.4.

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