LoginSignup
2
0

More than 5 years have passed since last update.

@includeの中のcalc()の中で変数を呼び出したい

Last updated at Posted at 2017-09-14

これを

.hoge {
  height: 32px;
  min-width: 32px;
  @include css3(border-radius, 16px);
}

↓こうしたい場合

$size: 32px;
.hoge {
  height: $size;
  min-width: $size;
  @include css3(border-radius, $sizeの半分);
}

@include の中で calc() を使ってこう↓書いてもだめで、

.hoge {
  height: $size;
  min-width: $size;
  @include css3(border-radius, calc( $size / 2));
}

@include の中で calc() を使うならこう↓書くといいみたい

.hoge {
  height: $size;
  min-width: $size;
  @include css3(border-radius, calc( #{$size} / 2));
}

一年に一回ぐらい検索してる気がするのでメモ。。。

2
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
2
0