I have a new Rails 3 project. I have installed Compass. I would like to generate the stylesheets in app/stylesheets using the Blueprint framework.
compass init rails /path/to/myrailsproject --using blueprint/semantic
Accept the defaults when prompted; your Sass files will be put in app/stylesheets and the compiled css will be put in public/stylesheets/compiled.
Related
I added the bootstrap-rubygem gem to my rails 5 application.
In my application.scss file I added:
#import "bootstrap";
Do I have access to the scss files that bootstrap uses? It is possible to install them so I can manually update them?
You have access to the scss files and you can change the variables, but the documentation is based on the latest version of Bootstrap v4.0.0-beta.3.
The bootstrap-rubygem uses different versions of bootstrap from the latest v4.0.0.beta3 to previous oldest alpha versions.
As explained in the documentation this is the files structure of the bootstrap project,
The scss files and partials from the twitter-bootstrap github repository are included in your bootstrap-rubygem assets/stylesheets/bootstrap folder so they will probably be available to you inside your rbenv or rvm folder.
I discourage you in going into the bootstrap source to edit those files, it is discouraged in the docs itself, instead use scss variables, functions and mixins as described in their documentation
https://getbootstrap.com/docs/4.0/getting-started/theming/#variable-defaults
I notice now that v4.0.0beta3 is available with the bootstrap-rubygem, as in my last probject I installed it with yarn and the files are included in /node-modules, but I don't really believe it is an advantage if the gem does not have bugs.
Im trying to put the bootstrap source files in my rails project but I am not seeing an "assets" folder in my app folder. Are the Image, Javascript, and CSS folders in "public" the same thing? If not then where do I put the source files? I am using ruby version 1.9.2-p290, rails version 3.0.19, and bootstrap version 2.3.2. Not sure if that makes a difference or not.
Why don't you just use a bootstrap gem like bootstrap-sass instead?
Look at this project: twitter-bootstrap-rails
It is an easy way to set up bootstrap in your Ruby on Rails project.
I'm trying to create a gem which represents a JS and CSS library and can be included in rails projects (currently using 3.2). All the style sheets are written in SASS and depend on the compass library.
I tried adding compass-rails to the Gemfile of the "external" gem and including it in the gems SASS files using
#import "compass"
However, back in the rails application (which has a dependency to this gem), this results in an error message:
File to import not found or unreadable: compass.
Am I doing something wrong?
Update: It seems to work if I add gem compass-rails to the Gemfile of the rails application. Any change to work around that?
Thanks a lot for your help!
Besides adding compass-rails to the Gemfile of the gem, you also need to require 'compass-rails' somewhere, adding it to lib/your_gem_name.rb inside the gem worked for me.
I've read the documentation on the asset pipeline. It says assets will be looked up in the 3 asset locations and compiled into the public folder, but I don't see any javascript in any of the 3 locations in the new rails project that I have just created. I have run bundle install and the jquery rails gems is installed. But grep for "jquery" gives no such file. Where is jquery located?
They're located within the gem itself.
i am trying to use sass in a rails 3.0.1 project that i am working on. I install the gem but when i create a scss file and add some style nothing happens. I've been searching for an answer and it seems others have haml installed as well, do I need this?
I think you should add the assets pipeline (Sprockets) in addition to SASS.
Here is a gist that explains the setup for Rails 3.0.x.
https://gist.github.com/911003