4

この小さな SCSS を CSS にコンパイルしようとしています。

$font-size: 16px;
$em: $font-size / 1em;

$column: 48px;
$gutter: 24px;

 $cols1: ( 1 * ($column + $gutter) - $gutter) / $em;
 $cols2: ( 2 * ($column + $gutter) - $gutter) / $em;
 $cols3: ( 3 * ($column + $gutter) - $gutter) / $em;
 $cols4: ( 4 * ($column + $gutter) - $gutter) / $em;
 $cols5: ( 5 * ($column + $gutter) - $gutter) / $em;
 $cols6: ( 6 * ($column + $gutter) - $gutter) / $em;
 $cols7: ( 7 * ($column + $gutter) - $gutter) / $em;
 $cols8: ( 8 * ($column + $gutter) - $gutter) / $em;
 $cols9: ( 9 * ($column + $gutter) - $gutter) / $em;
$cols10: (10 * ($column + $gutter) - $gutter) / $em;
$cols11: (11 * ($column + $gutter) - $gutter) / $em;
$cols12: (12 * ($column + $gutter) - $gutter) / $em;
$cols13: (13 * ($column + $gutter) - $gutter) / $em;
$cols14: (14 * ($column + $gutter) - $gutter) / $em;
$cols15: (15 * ($column + $gutter) - $gutter) / $em;
$cols16: (16 * ($column + $gutter) - $gutter) / $em;

sass grid.scss grid.css両方で試してみましたsass --watch grid.scss:grid.css- 私が得るのは空のcssファイルだけです。どうしたの?

4

1 に答える 1

8

@pjumble コメントで述べたように、変数を定義しているだけです。コードを取得し、追加のhello_worldステートメントを追加します。

$font-size: 16px;
$em: $font-size / 1em;

$column: 48px;
$gutter: 24px;

 $cols1: ( 1 * ($column + $gutter) - $gutter) / $em;
 $cols2: ( 2 * ($column + $gutter) - $gutter) / $em;
 $cols3: ( 3 * ($column + $gutter) - $gutter) / $em;
 $cols4: ( 4 * ($column + $gutter) - $gutter) / $em;
 $cols5: ( 5 * ($column + $gutter) - $gutter) / $em;
 $cols6: ( 6 * ($column + $gutter) - $gutter) / $em;
 $cols7: ( 7 * ($column + $gutter) - $gutter) / $em;
 $cols8: ( 8 * ($column + $gutter) - $gutter) / $em;
 $cols9: ( 9 * ($column + $gutter) - $gutter) / $em;
$cols10: (10 * ($column + $gutter) - $gutter) / $em;
$cols11: (11 * ($column + $gutter) - $gutter) / $em;
$cols12: (12 * ($column + $gutter) - $gutter) / $em;
$cols13: (13 * ($column + $gutter) - $gutter) / $em;
$cols14: (14 * ($column + $gutter) - $gutter) / $em;
$cols15: (15 * ($column + $gutter) - $gutter) / $em;
$cols16: (16 * ($column + $gutter) - $gutter) / $em;

.hello_world{ width: $column }

このコマンドsass grid.scss grid.cssは以下を生成します。

.hello_world {
  width: 48px; }
于 2012-08-18T13:53:34.143 に答える