Skip to content

Make @import Paths Relative #112

@tajmone

Description

@tajmone

I'm using normalize-scss (typey-chroma-kss fork) in a project. I didn't install the lib, just copied the relative sass folders into my project.

When I built the project I get error imports with a few files — for example in normalize-scss/base/grouping/_grouping.scss

// Dependencies.
@import 'components/divider/divider';

... because normalize-scss is not on Sass Load Paths.

I've solved it by adding normalize-scss' path to the SASS_PATH environment variable — on Windows:

SET "SASS_PATH=%~dp0vendors\normalize-scss"

And of course, it could be set via Sass command line options too.

I think that changing the dependencies @import paths to relative paths would be a better solution:

// Dependencies.
@import '../../components/divider/divider';

... this would allow normalize-scss to work out of the box without having to set Sass Load Paths; and it shouldn't create any problems for those who installed normalize-scss via NPM, Ruby Gem, etc.

It's just a small issue, for which there is an easy solution, but — unless preserving dependencies import paths the wat they currently are is really necessary — it would make its out-of-the-box use neater and simpler, and also avoid any potential clashes with other similar named modules on Sass Load Paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions