Rails 3.1 Load css in particular order

前端 未结 2 871
太阳男子
太阳男子 2020-12-08 04:52

I see that in development environment in rails 3.1 the css are loaded in alphabetic order and not in the order I want. I want a particular css file to be at the end so it ov

相关标签:
2条回答
  • 2020-12-08 05:17

    You can actually do something like:

    /* 
     *= require 'reset'
     *= require_self
     *= require_tree .
    */
    

    in your application.css file. This allows you to specify any number of stylesheets, such as a reset, to come before the tree without having to specify each individual file. The single quotes around reset are optional.

    Not trying to resurrect an old thread, just thought this might be helpful for some.

    0 讨论(0)
  • 2020-12-08 05:26

    It is better to specify the order of each and every files manually:

    /*
     * This is a manifest file that'll automatically include all the stylesheets available in this directory
     * and any sub-directories. 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 reset
     *= require groups
     *= require the_last
    *
    
    0 讨论(0)
提交回复
热议问题