Giter Club home page Giter Club logo

Comments (8)

metaskills avatar metaskills commented on August 29, 2024

I think this relates to issue #13 and an improper understanding of how to organize your files for less to work. Please read over that ticket and closely examine how things are organized in the dummy_app in the less project that we use for testing. If, needed, please communicate in ticket #13.

from less-rails.

mindreframer avatar mindreframer commented on August 29, 2024

Hey Ken, I DID read the ticket #13....
here the file structure:

less_test/app/assets/stylesheets (master)] ➔ find .
.
./application.css
./imported.less
./main.css.less
./pure.css

cat application.css
/*

  • This is a manifest file that'll be compiled into application.css, which will include all the files
  • listed below.
    *
  • Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
  • or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
    *
  • You're free to add application-wide styles to this file and they'll appear at the top of the
  • compiled file, but it's generally better to create a new file per style scope.
    *
    *= require_self
    *= require 'main'
    *= require_tree .
    */

cat main.css.less
.main{
color: #333;
}
@import 'imported'

// everything after import statement is ignored
.ignored_css{
color: #fff;
}

cat imported.less
.import_works{
color: #fff;
}

pls try it out, I spend 4 hours with source code reading and all the stuff... seems a real issue here
just git clone && bundle install && rails s && curl the css file. if it works for you, then my system is borked. dunno...

from less-rails.

metaskills avatar metaskills commented on August 29, 2024

I looked over the code before posting and I still assert your trying to organize your files that may be appropriate for Sass but will not work for Less.

from less-rails.

mindreframer avatar mindreframer commented on August 29, 2024

ok.
what I did:

application.css pulls main.css.less
it @imports imported.less (the indirection, than tickets #13 mentions)

from less-rails.

mindreframer avatar mindreframer commented on August 29, 2024

them imported less is not included... one more level of indirection needed or what is wrong? (the last comment was sent to early, keyboard shortcut... ) ...
sorry, if I'm PITA, just say, what's wrong...

from less-rails.

metaskills avatar metaskills commented on August 29, 2024

I don't have the time to look and post a good followup. But I do have time to give you a few pointers that may help. Here are some rules I follow no matter if I am using less or sass. (1) Only have one top level file in stylesheets dir and keep the names to match your layout. In this case application.css (2) Make that top level file a manifest only. Do not use require self, do not type CSS in there. (3) The require_tree directive is just plain evil unless you know what your doing. In this case. just require what you need.

About point 1, use sub directories for your files under stylesheets, for instance make an stylesheets/application folder and organize styles under there. Make a base.less file that is nothing but helpers logic only and @include that on your others to get a foundation for your base logic that each builds off off.

from less-rails.

mindreframer avatar mindreframer commented on August 29, 2024

thx for the elaborate answer. I restructed the files, see
https://github.com/mindreframer/less-rails-failing/tree/master/app/assets/stylesheets

still not imported. could you please say, where the error is. maybe inline forking the project. or just checking it out and running these 2 commands. it's only a couple of seconds. thx

from less-rails.

mindreframer avatar mindreframer commented on August 29, 2024

Hey Ken, the problem was a forgotten semicolon. It just did not blow up or did not show up as something not executed.
The filestructure was OK all the time.
Just in case, you yourself trip over this bug.

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.