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

Raw CSS @imports no longer work #245

Closed
samuelcolvin opened this issue Apr 24, 2018 · 5 comments · Fixed by #246
Closed

Raw CSS @imports no longer work #245

samuelcolvin opened this issue Apr 24, 2018 · 5 comments · Fixed by #246

Comments

@samuelcolvin
Copy link
Contributor

samuelcolvin commented Apr 24, 2018

See https://github.com/sass/libsass/releases/tag/3.5.3

  1. This changed the current behaviour of libass-python such that importing raw css files without the .css extension no longer works. Was this intentional? Might have been useful to include this in the changelog. see below
  2. I'm not seeing the deprecation warnings noted above. Maybe I'm not logging warnings or something? see below
  3. I want to continue to be able to import raw css files after 3.6 is released, will this require any changes to libsass-python? Eg. to support sass_option_push_import_extension
@samuelcolvin
Copy link
Contributor Author

samuelcolvin commented Apr 24, 2018

Sorry, I was being dumb above.

Importing css files is not working since the release of v14.3. As always you can do a css "import" eg. reference a separate file by using @import 'foobar.css'; but that's not what I'm looking for. I want @import 'foobar'; to truly import foobar.css into the compiled sass.

I guess this means libass-python need to support sass_option_push_import_extension, perhaps it already does and I need to work out how to use it, looking into it now

Part of the problem is that the 3.5.3 release notes are confusing

An @import that resolves to a .css file will produce a deprecation
warning. This feature will be removed in the upcoming 3.6 release.

For me at least it's just downright failing rather than giving a deprecation
warning.

@samuelcolvin samuelcolvin changed the title Raw CSS @imports Raw CSS @imports no longer work Apr 24, 2018
samuelcolvin added a commit to samuelcolvin/libsass-python that referenced this issue Apr 24, 2018
samuelcolvin added a commit to samuelcolvin/libsass-python that referenced this issue Apr 24, 2018
samuelcolvin added a commit to samuelcolvin/libsass-python that referenced this issue Apr 24, 2018
@asottile
Copy link
Member

CC @xzyfer -- this seems to be a regression from libsass's side:

$ tail -n999 test.scss wat.css 
==> test.scss <==
@import 'wat';

==> wat.css <==
a {
    b: c;
}
$ pysassc --version
pysassc 0.14.2 (sass/libsass 3.5.2)
$ pysassc test.scss 
a {
  b: c; }
$ pip install --upgrade libsass
...
$ pysassc --version
pysassc 0.14.3 (sass/libsass 3.5.3)
$ pysassc test.scss 
pysassc: error: Error: File to import not found or unreadable: wat.
        on line 1 of test.scss
>> @import 'wat';

   ^

@asottile
Copy link
Member

I've made an upstream issue: sass/libsass#2636

@samuelcolvin
Copy link
Contributor Author

This was done in sass/libsass#1963.

See sass/libsass@e690924 and the PR which preceded it sass/libsass#1964 this was their intended behaviour.

I've provided a fix in #246

@xzyfer
Copy link
Contributor

xzyfer commented Apr 24, 2018

Apologies this breaking change unintentionally landed in 3.5.3 instead of 3.6.0.

We plan to roll forward with the breaking change, and have update the release notes accordingly.

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

Successfully merging a pull request may close this issue.

3 participants