All pastes #2069575 Raw Edit

Mine

public text v1 · immutable
#2069575 ·published 2011-05-26 18:52 UTC
rendered paste body
how to better write this in sass? 

$grid2thirds: 480px;
$grid1third: 240px;
$grid1half: 480px;
$grid1whole: 960px;

#backmatter {
 .cols3 {
    .colfirst { width: $grid2thirds}
    .colsecond { width: $grid1third}
    .colthird { width: $grid1thirds}
 } 
 .cols2 {
    .colfirst { width: $grid1half}
    .colsecond { width: $grid1half}
    .colthird { width: $grid1half}
 }
 .cols1 {
    .colfirst { width: $grid1whole}
    .colsecond { width: $grid1whole}
    .colthird { width: $grid1whole}
 }
}

currently, it's outputting poor css (because i wrote poor sass)


#backmatter .cols3 .colfirst {
  width: 480px; }
#backmatter .cols3 .colsecond {
  width: 240px; }
#backmatter .cols3 .colthird {
  width: 240px; }
#backmatter .cols2 .colfirst {
  width: 480px; }
#backmatter .cols2 .colsecond {
  width: 480px; }
#backmatter .cols2 .colthird {
  width: 480px; }
#backmatter .cols1 .colfirst {
  width: 960px; }
#backmatter .cols1 .colsecond {
  width: 960px; }
#backmatter .cols1 .colthird {
  width: 960px; }

it should output at least like this for the values that are the same: 

#backmatter .cols3 .colfirst,
#backmatter .cols2 .colfirst,
#backmatter .cols2 .colsecond,
#backmatter .cols2 .colthird  {
  width: 480px; }
#backmatter .cols3 .colsecond,
#backmatter .cols3 .colthird {
  width: 240px; }

#backmatter .cols1 .colfirst,
#backmatter .cols1 .colthird,
#backmatter .cols1 .colsecond {
  width: 960px; }