Multiple @import bugs
wyoung opened this issue · 1 comments
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:
-
pyScss seems to require a file name extension. If you
@import "other"
, it won't findother.scss
, though the SASS docs say it should, andpsass
does find it. -
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 ofcompiler.py
. It works for my purposes, but I have no idea if it is "correct." -
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.
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