Note that there are some explanatory texts on larger screens.

plurals
  1. POSASS, Rails 3.1: Loading stylesheets in vendor/assets
    primarykey
    data
    text
    <p>I'm using SASS to load stylesheets in a Rails 3.1(sass-rails 3.1) app. For example, sass partials in <code>app/assets/stylesheets</code> are loaded using <code>@import</code> in <code>application.sass</code> -</p> <pre><code> @import "pages/common" @import "pages/**/*" @import "jquery-ui.css" </code></pre> <p>Now, I also want to load <code>vendor/assets/stylesheets</code>. Note that I'm not using <code>require vendor</code>, as <code>@import pages/*</code> seems to be the sass recommended way of doing it. Files here will be <code>css</code>, and not <code>sass</code> or <code>scss</code>. I cannot use <code>@import ../../../vendor/assets/stylesheets/*</code> as it works only for <code>sass</code> and <code>scss</code> files.</p> <p>Is there any way of doing this ?</p> <p><strong>Update</strong></p> <p>What I have now is this.</p> <p><code>application.css.scss</code></p> <pre><code>//= require_tree . //= require vendor //= require_self </code></pre> <p>This includes all the sass partials mentioned above. The <code>require vendor</code> in</p> <p><code>vendor/assets/stylesheets/vendor.css</code> looks like</p> <pre><code>//= require_tree . </code></pre> <p>A caveat of this approach is that sass mixins(user defined &amp; plugins) and common variables are not available in all partials. What I have now is a <code>_common_imports.sass</code> which I <code>@import</code> first thing in all partials.</p> <p><code>common_imports.sass</code></p> <pre><code>@import "colors" @import "compass/css3/gradient" @import "compass/css3/border-radius" @import "compass/css3/box-shadow" </code></pre> <p>Importing <code>common_imports</code> in all partials feels very repetitive.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload