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

HTTP urls break build #26

Open
jsalonen opened this issue May 26, 2015 · 11 comments
Open

HTTP urls break build #26

jsalonen opened this issue May 26, 2015 · 11 comments

Comments

@jsalonen
Copy link

Use the following test.css to reproduce:

.foo {
  background-image: url("http://www.example.com/image.png");
}

Running results in:

C:\Users\User\Project\node_modules\postcss\lib\lazy-result.js:175
            throw error;
                  ^
Error: ENOENT, no such file or directory 'C:\Users\User\Project\http:\www.example.com\image.png'
    at Error (native)
    at Object.fs.openSync (fs.js:500:18)
    at syncFileToBuffer (C:\Users\User\Project\node_modules\cssgrace\node_modules\image-size\lib\index.js:58:23)
    at module.exports (C:\Users\User\Project\node_modules\cssgrace\node_modules\image-size\lib\index.js:100:18)
    at imageSetMixin (C:\Users\User\Project\node_modules\cssgrace\lib\index.js:423:9)
    at C:\Users\User\Project\node_modules\cssgrace\lib\index.js:477:5
    at C:\Users\User\Project\node_modules\postcss\lib\container.js:119:34
    at C:\Users\User\Project\node_modules\postcss\lib\container.js:104:26
    at Rule.each (C:\Users\User\Project\node_modules\postcss\lib\container.js:91:22)
    at Rule.eachInside (C:\Users\User\Project\node_modules\postcss\lib\container.js:103:21)

Using cssgrace 2.0.2 on Windows 7

@yisibl
Copy link
Contributor

yisibl commented May 26, 2015

There is no support.
Next version fixed.

@jsalonen
Copy link
Author

Hi!

Thank you for your quick response.

I don't need cssgrace to resolve background images over HTTP. I just need that the build won't break if I have these urls in my stylesheet.

Looking forward to the next version.

@zenbrent
Copy link

Hi! How is work on the next version going? I just started a fork to do 2 things:

  1. to split out each rule into its own .js file, instead of keeping them all in one index.js file
  2. to make cssgrace configurable.

I need to disable the image handling in my own project. When I'm done, would you like me to submit a pull request, or are you already working on this?

@zenbrent
Copy link

I split all the tasks out in my fork at https://github.com/zenbrent/cssgrace

I also made it so it doesn't process images that aren't referenced with image-width or image-height, so if I'm using an image that is served at a different path than it is on my hard drive, there isn't an error. (e.g. I reference url(/images/logo.png), but that's obv. not how it's set up on my computer.)
I haven't made it configurable yet, I may do that in the future.

I agree with #10 that some of these features would be best served as a separate project. For my job, I don't want cssgrace to handle my images, but I do want it to make my css work with older browsers! For my personal projects I would love the image handling, but I don't care about very old browsers.

As always, thank you for all your work. This is a very useful and well-done project. :)

@yisibl
Copy link
Contributor

yisibl commented May 29, 2015

@zenbrent

Thank you for your work!

Yeah, the next version I will "to split out each rule into its own .js file" and add browser config.

Maybe like this:

input:

@browser ie>=8;

.foo {
  display: inline-block;
}

output:

.foo {
  display: inline-block;
}

When you need to be compatible with the old browser, the output of the corresponding syntax sugar.

input:

@browser ie>=6;

.foo {
  display: inline-block;
}

output:

.foo {
  display: inline-block;
  *display: inline;
  *zoom: 1;
}

@zenbrent
Copy link

Ok, awesome! Would you like me to submit my changes as a pull request?

@miniflycn
Copy link

I'm also waiting for this issue's fixed anxiously

@yisibl
Copy link
Contributor

yisibl commented Jun 5, 2015

@miniflycn I'm sorry, I'll fix it soon.

@yisibl
Copy link
Contributor

yisibl commented Jun 5, 2015

@zenbrent No problem! I am looking forward your pull request.

@ghost
Copy link

ghost commented Oct 1, 2015

Hi @yisibl any updates on this?

@mingzepeng
Copy link

url绝对路径的问题,依旧没有解决啊

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

5 participants