LoginSignup
1
2

More than 5 years have passed since last update.

Stylusでpxの計算をする時には括弧をつける

Last updated at Posted at 2015-03-15

計算式だと認識してくれないケース

NG

font-size: 14px / 1.5;

OK

font-size: (14px / 1.5);

Ref) https://github.com/LearnBoost/stylus/issues/658

優先順位が誤っているケース

これは

foo = 10px

.klass
  margin 5px -(foo)

こう解釈されてしまう

.klass {
  margin: -5px;
}
/*
  margin: 5px -10px;
  のつもりだった
*/

なのでこの場合も執拗に括弧でくくる

.klass
  margin 5px (-(foo));
1
2
1

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