Giter Club home page Giter Club logo

play-module-less's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

play-module-less's Issues

Use local cache

I think the compiled less content should be stored in local cache, not in the global cache. Play use EnCache for local Cache. I think local cache could improve the performance .

less file locked by Play under Windows

Play started locking .less files when I started using less (it never locked anything before).

To reproduce, I believe this would work:

  1. Use play-less in a Windows project
  2. Load a page that uses less.
  3. Try to delete the less file.

less and press

Hi

When I use press and less module together I obtain an Exception on file compression.

Oops: StringIndexOutOfBoundsException
An unexpected error occured caused by exception StringIndexOutOfBoundsException: String index out of range: 211

play.exceptions.UnexpectedException: Unexpected Error
at press.Compressor.writeCompressedFile(Compressor.java:352)
at press.Compressor.getCompressedFile(Compressor.java:323)
at press.Compressor.getCompressedFile(Compressor.java:291)
at press.JSCompressor.getCompressedFile(JSCompressor.java:32)
at controllers.press.Press.getCompressedJS(Press.java:25)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:548)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:502)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:478)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 211
at java.lang.String.substring(String.java:1934)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceString(JavaScriptCompressor.java:267)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:330)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.(JavaScriptCompressor.java:533)
at press.JSCompressor$1.compress(JSCompressor.java:46)
at press.Compressor.compress(Compressor.java:407)
at press.Compressor.writeCompressedFile(Compressor.java:345)
... 10 more

I understand that it is more a press bug, and I have open an issue on press module, but perhaps this is interesting for you.

bootstrap.less not compiled

I have a simple test working with a less file here /public/stylesheets/test.less
It compiles and delivers css on request. However, twitter bootstrap.less does not. It returns empty.
My template:
link type="text/css" rel="stylesheet" media="screen" href="@{'/public/stylesheets/test.less'}"
link type="text/css" rel="stylesheet" media="screen" href="@{'/public/bootstrap/less/bootstrap.less'}"

The docs say that every .less file under /public/ will be compiled. So, I thought dropping the bootstrap folders in would work? No?

bootstrap 2.0.1
play-module-less 0.9
play 1.2.4

Suggestions?

Dependencies.yml

My Dependencies file looks like so...

Application dependencies

require:
- play -> less 0.3

However it doens't seem to compile my less files, where as adding it to application.conf does, though that method is deprecated.

License

Couldn't find anything declaring a license for this project. Under what license is this project released?

Escaping does not work

Just include this mixin:

.opacity(@op)
{
filter: ~"alpha(opacity=@op)";
opacity: @op/100;
}

Note: you might have to use it - just put .opacity(50) on any selector.

The output goes totally hay-wire. I haven't found any other way to define the above mixin in a way that will work.

Exception during parsing

com.asual.lesscss.LessException: Parse Error: Syntax Error on line 31 (line 31, column 2) near
background-image: -ms-linear-gradient(top, #f4f4f4 0%, #eeeeee 48%, #f6f6f6 50%, #ffffff 80%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
background-image: linear-gradient(top, #f4f4f4 0%, #eeeeee 48%, #f6f6f6 50%, #ffffff 80%);
at com.asual.lesscss.LessEngine.parseLessException(LessEngine.java:185)
at com.asual.lesscss.LessEngine.compile(LessEngine.java:120)
at play.modules.less.PlayLessEngine.compile(PlayLessEngine.java:99)
at play.modules.less.PlayLessEngine.get(PlayLessEngine.java:43)
at play.modules.less.Plugin.handleOk(Plugin.java:61)
at play.modules.less.Plugin.handleResponse(Plugin.java:46)
at play.modules.less.Plugin.serveStatic(Plugin.java:28)
at play.plugins.PluginCollection.serveStatic(PluginCollection.java:641)
at play.server.PlayHandler.serveStatic(PlayHandler.java:849)
at Invocation.HTTP Request(Play!)

CSS is re-sent for each visits

This looks like two problems actually...

Firstly, the browser re-GETs the *.less files for each page visits. That's unlike with plain *.css or *.js, where after the first visit, it doesn't even send a GET unless you hit Ctlr+R. My quick guess is that the cause of this behavior is that the response from the Less module contains this line:

Cache-Control: no-cache

Secondly, the CSS is always resent with HTTP 200 OK instead of responding with HTTP 304 Not Modified. So, I visit a pages for the 2nd time, and the client (Firefox) sends this:

GET /public/stylesheets/main.less HTTP/1.1
...
If-Modified-Since: Sun, 24 Jul 2011 12:57:57 GMT
If-None-Match: "1311512277400-946741085"

and Play answers with:

HTTP/1.1 200 OK
...
Etag: "1311512277400-946741085"
Last-Modified: Sun, 24 Jul 2011 12:57:57 GMT

The Etag and the timestamp are the same, yet it wasn't 304.

This was on Play 1.2.2, with the standard "play new" app with only Less 0.3 installed and main.css is replaced with main.less. I have tried it both in dev and prod mode. Used Firefox 5 + LiveHTTPHeaders + Firebug. Everything works fine with plain CSS.

Issue with negative & varaibles

I'm trying to use the less plugin with twitter bootstrap but I have this issue
(could be related to the less lib you use)

@gridGutterWidth:   20px;

.row {
   .clearfix();
  margin-left: -@gridGutterWidth;
}

this gets compiled into an invalid css, mind the space between the minus and the 20.

.row{
  margin-left: - 20px;
  ...
}

Any suggestions on how to fix this?

TwitterBoostrap v2.0

The current version of the Less module does not compile the latest TwitterBootstrap v2.0 (https://github.com/twitter/bootstrap/tree/2.0-wip).

It throws the following exception :

com.asual.lesscss.LessException: Parse Error: Syntax Error on line 427 (line 427, column 4) near

&+.add-on {
  *margin-left: -21px;
at com.asual.lesscss.LessEngine.parseLessException(LessEngine.java:182)
at com.asual.lesscss.LessEngine.compile(LessEngine.java:104)...

I tried with the latest lesscss-engine JAR (1.1.5), and it worked well.

Since TwitterBootstrap begins to be widely used, please update the lesscss-engine lib to the latest ;-)

Thanks,
Nico

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.