0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

1つのSassで複数のcssファイルを出力する方法

Posted at

もっといい方法ないかなぁと探しています。。

##やりたいこと
gulpやsassを使って複数のCSSを出力する

style.sass
↓コンパイル
css01.css
css02.css
css03.css

三つのファイルの違いは、例えばメインカラーが違う。メインのイメージ画像が違うなど
一部のみ違う場合がほとんど。

##sassのif文を使う

sass

//ここに3パターンのどれかをセット
$design: 3;


@if $design == 1 {

  $main-color: red;

} @else if $design == 2 {

  $main-color: blue;

} @else if $design == 3 {

  $main-color: black;

}

上記のような感じで、3回コンパイルしているけど、もろ非効率な感じ;

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?