Giter Club home page Giter Club logo

Comments (3)

metaskills avatar metaskills commented on July 25, 2024

If it is possible, I am all for it. But I am not sure not it is since we have to bridge a gap with with a JavaScript interpreter, not a Ruby one. The way the context is setup for the JavaScript bridge, there is no way to bridge that multiple times to make several requires stitch it all together. We have to relay on the single JavaScript context and let Less.js do it.s thing.

Still I am open minded if possible. Especially as things like ExecJS is used vs therubyracer for less.rb and perhaps when sprockets and/or both move to being able to do CommonJS, etc. Well above my skills at the moment.

from less-rails.

joliss avatar joliss commented on July 25, 2024

But I am not sure not it is possible since we have to bridge a gap with with a JavaScript interpreter, not a Ruby one.

Right. So you can't just call into Ruby code from LESS.

Perhaps you want to bring this up with the Sprockets folks, just to keep them in the loop? less-rails is the most important/popular non-Rails-standard asset handler I can think of, so it can't hurt to keep them informed. And maybe they have some idea.

from less-rails.

metaskills avatar metaskills commented on July 25, 2024

Hey @joliss, finally cleaning up some tickets.

With Sass, the following statements in application.css.scss seem to be equivalent:
@import "test";
//= require test

This is false. When you import, you are in Less/Sass land and you get all the benefit of that template engine. For example, in Sass's extensions on @import, that file will add to the rendering context of the file that imported it. It benefits from additional helpers, variables, etc. This is not true in a sprockets require.

Here is a gist that adds a test case and shows what you want done. It yields the following error: Less::Error: 'stupid_filename.less' wasn't found

There is no benefit here and it is fighting an uphill battle. First, you would have to convince the less maintainers it is a good idea, but for what benefit? When you break it down the only need for a .css.less file is to start off the hint to Sprockets that xyz template engine will be used. From there on down, it is Turtles Engine rendering all the way. Hence, keep with their constraints and enjoy the few extras like asset helpers that are provided.

BTW @joliss it was super great to hang out at JSConf!!!!

from less-rails.

Related Issues (20)

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.