Giter Club home page Giter Club logo

Comments (7)

metaskills avatar metaskills commented on August 29, 2024

Honestly, I really did think about that tying into the assets config for compress and decided not to since that is a gateway setting to whole other libraries that did the compression. So I let the less compress just focus on it's own config as a first prove of concept of passing down LESS specific configs to the template handler. I really am on the fence about the proper place, but I think it may be fine the way it is.

That said, are you using the latest version? I tested that the compress setting works in the test suite and I even utilized it so I can get an output that was more easily assertable. Do you think you can express a test that breaks or give me more details?

from less-rails.

erikdahlstrand avatar erikdahlstrand commented on August 29, 2024

This is my current Gemfile

group :assets do
  gem 'less-rails-bootstrap', '~>1.3.0'
end

Explicitly adding less-rails to the Gemfile solves the problem.

I think the gem should use the existing Rails settings (principle of least surprise)

config.assets.compress = true
config.assets.css_compressor = :less (should default to less if less-rails[-bootstrap] is in your Gemfile)

If you for some reason wants another css compressor it's just a matter of changing the last line. Just My Two Cents.

Thank you for working on this gem.

from less-rails.

metaskills avatar metaskills commented on August 29, 2024

Good point about the compress options. I like it. BTW, perhaps your problem could have been solved by doing:

$ bundle update less-rails

from less-rails.

erikdahlstrand avatar erikdahlstrand commented on August 29, 2024

I've tried that and bundler reports

Using less-rails (2.0.2)

Still doesn't work unless I "require" it in the Gemfile

from less-rails.

metaskills avatar metaskills commented on August 29, 2024

This may mean I am not requiring less-rails from the bootstrap project. But I thought it was.
https://github.com/metaskills/less-rails-bootstrap/blob/master/lib/less-rails-bootstrap.rb#L8

from less-rails.

metaskills avatar metaskills commented on August 29, 2024

Might be related to this thread on rails-core too.
http://groups.google.com/group/rubyonrails-core/browse_thread/thread/919611c67dc956b

from less-rails.

metaskills avatar metaskills commented on August 29, 2024

Comments are from @janv

Yeah, this really is a nasty issue. It boils down to Less removing the escaping of
the filter in the first pass (evaluation) and then encountering it unescaped in the
second (compression) pass. I'd consider this is a bug in Less itself, compilation
of templates should be idempotent.

Nah, this is not a bug in Less.js it is documented behavior.
http://lesscss.org/#-escaping

If anything, it is a bug with less-rails and thinking I could use less as a way to help pear down it's own parsed files. I may have to revert this commit, add some documentation about how you will need your own compressor if you don't have less's compression turned on.

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.