How does one load a CSS framework in Rails 3.1?

后端 未结 7 519
甜味超标
甜味超标 2020-12-24 07:03

I am trying to load a CSS framework, Blueprint, onto my Rails 3.1 application.

In Rails 3.0+, I would have something like this in my views/layouts/application.html.e

7条回答
  •  臣服心动
    2020-12-24 07:45

    A different way of doing things:

    Make app/assets/stylesheets/custom.css

    Then change custom.css to use the files needed:

    /*
     *= require_self
     *= require 'colorbox/colorbox'
     *= require 'uploadify'
     *= require 'scaffold'
     *= require 'main'
    */
    

    Finally change the link tag in your layout (make sure to remove the "application" stylesheet)

    = stylesheet_link_tag    "custom"
    

    You can then add any other stylesheet manually (like "ie" specific) and other groups of stylesheets (like blueprint to load all blueprint files...)

    You might also need (in your production.rb)

      # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
      config.assets.precompile += %w(custom.css)
    

提交回复
热议问题