greenlaw110 / greenscript

A tool help web developers manage javascript/css rendering, including minimize and dependence management
42 stars 24 forks source link

CSS and background url #18

Closed yanickrochon closed 13 years ago

yanickrochon commented 13 years ago

When minimizing CSS, any url(path) become wrong and generate 404 errors.

For example, when including a jQuery UI theme in the #{greenscript.css} tag, and when minimizing is enable, all the theme's images are not loaded because the minimized CSS is not where the original CSS is and all paths are relative to the original CSS.

The fix should include having a path prefix to make sure all resource paths are preserved. This should be a configurable option, and a simple regex replace should do the trick.

Note : see my question on SO : http://stackoverflow.com/questions/7207554/play-framework-greenscript-url-css-rules-wrong-path

greenlaw110 commented 13 years ago

Fixed in v1.2.6c.

yanickrochon commented 13 years ago

Is it me or the CSS is always minified? Starting play 1.2.3 un dev mode and without any greenscript options, all css are minified (not compressed). Moreover, the fix does not solve every problems. I have a custom jQuery UI theme and the icons' paths are wrong. I will try and investigate more about this, but the problem is just annoying.

greenlaw110 commented 13 years ago

Can you send me the directory layout of your custom jQuery UI? I also need to know your route to css and js files if it's not default '/public/stylesheets' and '/public/javascript'

And yes 1.2.3 minimize css anyway because it will call the URL processing and LESS compilation anyway. Also I don't think this will bother debugging as when you change your css content, the minimize process will be conducted again.

On Wed, Sep 14, 2011 at 12:37 AM, Yanick Rochon < reply@reply.github.com>wrote:

Is it me or the CSS is always minified? Starting play 1.2.3 un dev mode and without any greenscript options, all css are minified (not compressed). Moreover, the fix does not solve every problems. I have a custom jQuery UI theme and the icons' paths are wrong. I will try and investigate more about this, but the problem is just annoying.

Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/issues/18#issuecomment-2082368

greenlaw110 commented 13 years ago

Hi I confirmed the issue. Will come up with fix soon.

On Wed, Sep 14, 2011 at 6:31 AM, green greenlaw110@gmail.com wrote:

Can you send me the directory layout of your custom jQuery UI? I also need to know your route to css and js files if it's not default '/public/stylesheets' and '/public/javascript'

And yes 1.2.3 minimize css anyway because it will call the URL processing and LESS compilation anyway. Also I don't think this will bother debugging as when you change your css content, the minimize process will be conducted again.

On Wed, Sep 14, 2011 at 12:37 AM, Yanick Rochon < reply@reply.github.com>wrote:

Is it me or the CSS is always minified? Starting play 1.2.3 un dev mode and without any greenscript options, all css are minified (not compressed). Moreover, the fix does not solve every problems. I have a custom jQuery UI theme and the icons' paths are wrong. I will try and investigate more about this, but the problem is just annoying.

Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/issues/18#issuecomment-2082368

greenlaw110 commented 13 years ago

please try the latest v1.2.6e version. I have added a jquery-ui test app and it works.