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

Variables in urls #63

Closed
davidgilbertson opened this issue Aug 31, 2015 · 6 comments
Closed

Variables in urls #63

davidgilbertson opened this issue Aug 31, 2015 · 6 comments

Comments

@davidgilbertson
Copy link

I have this SCSS

.value-proposition {
    $imagesUrl: '/images/';
    background: center url($imagesUrl + 'slide-01-bg.png') no-repeat;
    background-size: cover;
}

Which generates this error:

c:\www\mysite\node_modules\sass-lint\lib\groot.js:21
    throw new Error('Parsing error' + fileInfo + ': ' + e.message);
          ^
Error: Parsing error at app/components/App/migrated-sass/_CBE_project_defaults.scss: Please check validity of the block
starting from line #5
    at module.exports (c:\www\mysite\node_modules\sass-lint\lib\groot.js:21:11)
    at Function.sassLint.lintText (c:\www\mysite\node_modules\sass-lint\index.js:23:13)
    at c:\www\mysite\node_modules\sass-lint\index.js:73:21
    at Array.forEach (native)
    at Function.sassLint.lintFiles (c:\www\mysite\node_modules\sass-lint\index.js:72:9)
    at detectPattern (c:\www\mysite\node_modules\sass-lint\bin\sass-lint.js:16:18)
    at Object.<anonymous> (c:\www\mysite\node_modules\sass-lint\bin\sass-lint.js:54:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Let me know if you want a separate issue, but the line number is also mis-reported. On a large file... ha, I just worked it out while typing this, the reported line number is exactly double the correct number minus one.

@Snugug
Copy link
Member

Snugug commented Aug 31, 2015

This is, again, an issue with our AST. If you could report the issue on the Gonzales issue queue and link this issue so we can track it, that'd be awesome.

@davidgilbertson
Copy link
Author

It looks like the gonzales-pe issue Concatenation does not work within url in SCSS.

@davidgilbertson
Copy link
Author

For reference, using sass string interpolation works

.value-proposition {
    $imagesUrl: '/images/';
    background: center url('#{$imagesUrl}slide-01-bg.png') no-repeat;
    background-size: cover;
}

With or without the quote marks.

@DanPurdy
Copy link
Member

This is still an issue as of version 3.2.1 of gonzales-pe, I have updated the original issue filed with the gonzales-pe repo as linked to above.

@bgriffith
Copy link
Member

Update - This is still broken in [email protected].

@bgriffith
Copy link
Member

This is fixed in the newly released version v1.11.0. Please let me know if you still have issues. Thanks!

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

No branches or pull requests

4 participants