0

我会在 Twitter Bootstrap SASS 的 mixin 中使用 offset 变量,但它似乎不起作用。

#headSearch{
 @include makeColumn(6,2);

}

因此,TBS sass 代码库:

@mixin makeColumn($columns: 1, $offset: 0) {
  float: left;
  margin-left: ($gridColumnWidth * $offset) + ($gridGutterWidth * ($offset - 1)) + ($gridGutterWidth * 2);
  width: ($gridColumnWidth * $columns) + ($gridGutterWidth * ($columns - 1));
}

谢谢

编辑:

<div id="main">



 <!-- ______________________ CONTENT TOP REGION _______________________ -->
          <?php if (!empty($page['content_top'])): ?>
 <div class="rowZone">
 <section id="content-top"> <?php print render($page['content_top']); ?> </section><!-- /#content-top -->
          </div><!-- /rowZone -->
              <?php endif; ?>


   <!-- ______________________ ZONE DIAPO PANORAMIQUE _______________________ -->
               <?php if (!empty($page['DiapoHP'])): ?>
   <div class="rowZone">
       <section id="HPDiapo"><?php print render($page['DiapoHP']); ?></section>
       </div><!-- /rowZone -->
   <?php endif; ?>

<!-- ______________________ HOMEPAGE BAS _______________________ -->
<div class="rowZone">
<!-- ______________________ PARTIE BAS GAUCHE _______________________ -->

    <?php if (!empty($page['HPBasGauche'])): ?>

<section id="BasGaucheHP"> 
        <?php print render($page['HPBasGauche']); ?></section>

<?php endif; ?>

<!-- ______________________ PARTIE BAS DROITE _______________________ -->
    <?php if (!empty($page['HPBasDroit'])): ?>

<section id="BasDroitHP">
        <?php print render($page['HPBasDroit']); ?>
    </section><!-- /BasDroitHP --> 

<?php endif; ?>
    </div><!-- /rowZone -->
 </div> <!-- /mainPage -->

和 scss 代码:

@import "../bootstrap/lib/bootstrap.scss";
@import "../bootstrap/lib/responsive.scss";
#main{
  @include clearfix;
}
.rowZone{
  @extend .row-fluid; }
#HPDiapo{
  @include makeColumn(12);
  @include clearfix;
  padding:10px 0 0;
}
#content-top{
    @include makeColumn(12);
    @include clearfix;
   }
#BasGaucheHP{
      @include makeColumn(6);
      @include clearfix;
}
#BasDroitHP{
 @include makeColumn(6);
}

我知道我猜我不需要将 clearfix mixin 包含在 makeRow mixin 中。在我看来,这个想法是将列放入容器中,然后每一行自己堆叠(在移动设备上同上)。实际上我不知道我是否需要使用流式行进行响应式设计或固定布局就足够了。那么,我的逻辑好吗?

谢谢

4

0 回答 0