Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use twitter bootstrap with bootstrap-sass in rails app?
    primarykey
    data
    text
    <p>I'm quite new to this, but i cannot figure out the problem.</p> <p>In twitter bootstrap i would use :</p> <pre><code>&lt;div class="row-fluid"&gt; &lt;div class="span2"&gt;Column1&lt;/div&gt; &lt;div class="span6"&gt;Column2&lt;/div&gt; &lt;/div&gt; </code></pre> <p>And it all works fine. But i do not want to write spanX and spanY directly into my html file, rather i would like to give meaningful class names, for example:</p> <pre><code>&lt;div class="user-container"&gt; &lt;div class="user-filter"&gt;First Column&lt;/div&gt; &lt;div class="user-list"&gt;Second Column&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Given the fact, that i'm using <a href="https://github.com/thomas-mcdonald/bootstrap-sass">https://github.com/thomas-mcdonald/bootstrap-sass</a>, how should i write my scss file? I've tried the following, and it does not work (two columns are not displayed):</p> <pre><code>@import "bootstrap"; @import "bootstrap-responsive"; .user-container { @extend .row-fluid; } .user-filter { @extend .span2; } .user-list { @extend .span10; } </code></pre> <p>If i look at the generated code, it seems to me that everything should be ok:</p> <pre><code>/* line 164, ../../../../../.rvm/gems/ruby-1.9.3-p125/gems/bootstrap-sass-2.0.0/vendor/assets/stylesheets/bootstrap/_mixins.scss */ .span2, .user-filter { width: 140px; } </code></pre> <p>and so on.</p> <p>What am i doing wrong?</p> <p><strong>UPDATE:</strong></p> <p>ok, just to be clear what is wrong - the columns are laid out as rows (one after another) rather like true columns (one next to each other), eg.:</p> <p>with bootstrap: Column1 Column2<br> with my custom classes:<br> First Column<br> Second Column </p> <p>I've inspected the elements layout in Chrome and it seems that bootstrap classes have float property, and mine - no. Looking at css source i see classes like this:</p> <pre><code>[class*="span"] { float: left; margin-left: 20px; } </code></pre> <p>So in my case i think it should generate something like : [class*="user-filter"] { float: left; margin-left: 20px; }</p> <p>or not?</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