category: sass

CSS - SASS handle index

on 2014-07-10

CSS - SASS handle index

Can use var control z-index

$elements: con, slider, masthead;

.masthead {
  /* z-index: 3 */
  z-index: index($elements, masthead);
}

.slider {
  /* z-index: 2 */
  z-index: index($elements, slider);
}

.con {
  /* z-index: 1 */
  z-index: index($elements, con);
}

Refer - 使用 sass 有效控管 z-index 圖層順序

Sass compile two spaces

on 2013-11-20

Sass compile two spaces

Use Sass compile to css css lndent is 2 spaces if want 4 spaces Must modify this sass source code

sass-3.2.10/lib/sass/tree/visitors/to_css.rb
# before
tab_str = '  ' * (@tabs + node.tabs)
# after
tab_str = '    ' * (@tabs + node.tabs)

Refer - Change indentation in Sass