Giter Club home page Giter Club logo

Comments (10)

cj avatar cj commented on August 29, 2024

I'm actually having the same issue with rails 3.2:

I have a file in vendor/assets/stylesheets/twitter/boostrap/datepicker.less and in my application.css i have *= require twitter/bootstrap/datepicker but I'm getting couldn't find file 'twitter/bootstrap/datepicker'

Changing the file from .less to .css rails finds the file just fine.....

from less-rails.

metaskills avatar metaskills commented on August 29, 2024

Your issue is an organization one and knowing how to deal with less in rails in general. Basically a sprockets require will only work for a .css.less and that file would be a manifest of other .less files using LESS' @import. Learn about proper structure via the less-rails-bootstrap-test project.

from less-rails.

cj avatar cj commented on August 29, 2024

@metaskills I've tried with .css.less too and it still doesn't want to import from either vendor/assets/stylesheets/twitter/boostrap/datepicker.css.less or vendor/assets/stylesheets/twitter/boostrap/datepicker.less.

I don't want to keep files inside app/assets.....

from less-rails.

metaskills avatar metaskills commented on August 29, 2024

I still think this is just a misunderstanding. Let me explain. You said "Changing the file from .less to .css rails finds the file just fine.....". So that means you can use a sprockets directive for your less manifest file that you want in vendor/assets/stylesheets/twitter/boostrap/datepicker.css.less by adding *= require twitter/bootstrap/datepicker to your other manifest. Now, from here you would do @import "twitter/boostrap/datepicker"; and that would search all the LESS paths that both less-rails and/or less-rails-bootstrap setup for LESS.js

from less-rails.

cj avatar cj commented on August 29, 2024

@metaskills I think you miss read what I put, I tried it exactly how you just wrote it and it does not work:

from less-rails.

cj avatar cj commented on August 29, 2024

Also I noticed we both had a typo boostrap instead of bootstrap, but in my project I have it as bootstrap and it still doesn't work with @import.

from less-rails.

metaskills avatar metaskills commented on August 29, 2024

Can you console into your app and show me the paths for both less and assets? I think it should be something like this MyProject::Application.config.less.paths.

Also, can you express you case in a test? I have setup this project to account for all sorts of different usages via the dummy project and worked hard on making helpers to make this easy. Maybe that would avoid bad assumptions on my part.

from less-rails.

cj avatar cj commented on August 29, 2024
Loading development environment (Rails 3.2.1)
1.9.3 (main):0 > Redline::Application.config.less.paths
=> [
  [0] "/Users/cj/Dropbox/sd/acd/redline/app/assets/stylesheets",
  [1] "/Users/cj/Dropbox/sd/acd/redline/vendor/assets/stylesheets",
  [2] "/Users/cj/Dropbox/sd/acd/redline/vendor/gems/ruby/1.9.1/gems/twitter-bootstrap-rails-2.0.3/vendor/toolkit"
]
1.

So I just have vendor/assets/stylesheets/twitter/bootstrap/datepicker.css.less then in my /Users/cj/Dropbox/sd/acd/redline/app/assets/stylesheets/bootstrap.css file I have:

@import "twitter/bootstrap/bootstrap";
@import "twitter/bootstrap/datepicker"

But it doesn't import the datepicker and actually stops anything loading after it (with no errors).

Thank you for trying to help.

p.s. I can setup a clean repo later with just this example in and push it. I'm stumped as to why it's not working.

from less-rails.

metaskills avatar metaskills commented on August 29, 2024

Maybe no sem-colon bug?

from less-rails.

cj avatar cj commented on August 29, 2024

aaaaaaaand this is why I stopped using php.... I'm going to setup/make some less lint for vim so this doesn't happen again. Thank you so much for bearing with me and helping me solve it!!! I owe you a beer :)

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.