1

How to include LESS or SASS css framework in a Rhomobile application?? I want the application to recognize .less or .css.scss files,use mixins and media queries. How can I achieve that?? Thanks.

Update: After installing sass gem and running the task created in the rake file,my original css file is not getting executed and I get this in my console output:

CMD: vcbuild/M4 rhodes.sln "Release |Win32" *rake aborted!* No such file or directory - vcbuild

remonses
  • 402
  • 1
  • 4
  • 17

1 Answers1

1

You will need to preprocess it and convert to CSS before compiling. This could be done creating another rake task that preprocess your SCSS files, generating the CSS output and, finally, invoking the actual rhodes compile task.

Update:

You could do this by installing SASS gem (gem install sass) and adding this to the end of your Rakefile:

task :compile_scss_and_run do
  Dir.chdir $app_path do
    system "scss --update public\\css\\*.scss"
  end
  Rake::Task["run:win32"].invoke
end

Please change 'run:win32' with the task you used to compile your Rhodes app. After, simply run this on command line: rake compile_scss_and_run.

In your layout.erb file you must reference the *.css files and not the originals *.scss.

Douglas Lise
  • 1,466
  • 1
  • 20
  • 46
  • Well,I'm new to Rhomobile application and rhodes and I'm working on a windows environment.Not very sure how to do what you're asking me to do.Can u tell me what specific changes will I have to make in my Rakefile or in my build.yml file?? – remonses Mar 11 '14 at 04:52
  • I've updated my answer with the appropriated instructions on how to implement it. Please try and post here if it doesn't work. – Douglas Lise Mar 11 '14 at 12:03
  • Thank you so much for replying.I see, you have defined a task named **compile_scss_and_run**.Will i have to change the "run:win32" with that task name?? – remonses Mar 12 '14 at 05:56
  • No, you only need to change "run:win32" with another task name if you need to use another task, like "device:android:production". For running in win32, only use the code "as is". – Douglas Lise Mar 12 '14 at 11:40
  • I have edited my question with the console output.Unfortunately, I couldn't post the relevant snapshot due to reputation shortage. – remonses Mar 13 '14 at 05:16
  • This is not related with the new task. This should happen even if you execute directly rake run:win32 – Douglas Lise Mar 13 '14 at 11:15
  • Yes..it happens when I do rake run:win32.I don't really know what to do. – remonses Mar 13 '14 at 13:09
  • After installing visual studio, add this to rhobuild.yml (http://goo.gl/4sQsHq): env: paths: vcbuild: /vcbuild.exe – Douglas Lise Mar 13 '14 at 14:24