Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple @import bugs #370

Open
wyoung opened this issue Jan 8, 2018 · 1 comment
Open

Multiple @import bugs #370

wyoung opened this issue Jan 8, 2018 · 1 comment

Comments

@wyoung
Copy link

wyoung commented Jan 8, 2018

I'm using pyScss as a fallback on systems where I cannot use my preferred SCSS compiler, psass due to lack of C++03 support. The same systems also have a version of Ruby too old to run the official sass compiler, leading me eventually to pyScss, since I can get Python 2.7 for these systems.

I have found numerous regressions in behavior between pyScss and psass in @import handling, and my reading of the SASS docs on @import supports the psass way of doing things:

  1. pyScss seems to require a file name extension. If you @import "other", it won't find other.scss, though the SASS docs say it should, and psass does find it.

  2. pyScss only supports the *.css extension out of the box, but I'm importing SCSS syntax files, not CSS. I've hacked around this by changing "static" to "dynamic" on line 823 of compiler.py. It works for my purposes, but I have no idea if it is "correct."

  3. An SCSS variable defined in an @imported file doesn't appear to be visible in the file that @imported it. Simple test case:

    x.scss:

     $x: 42px;
    

    y.scss:

     @import "x.scss";
     body {
         width: $x;
     }
    

I have worked around all of these by writing my own SCSS @import preprocessor which produces a flat output file that pyScss will process. (It basically works like the old C preprocessor.) I believe my preprocessor follows the SCSS spec for this, so that ultimately, this preprocessor should not be necessary.

@dmagui
Copy link

dmagui commented Jun 2, 2020

I have also had the issue of @imported variables not being visible to other files, which is a bit of. a nightmare if you choose to write very modular sass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants