LoginSignup
2
2

More than 5 years have passed since last update.

Bootstrap2と3でのカラー変数の違い

Last updated at Posted at 2015-02-02

背景

Ruby on Rails チュートリアルを参考に、Bootstrap3を用いてWebアプリケーションの作成を行っている際、チュートリアルとのバージョンの違い(チュートリアルはBootstrap2)により、Bootstrapフレームワークで定義されているカラー変数の参照がうまくできませんでした。

問題

Rails Tutorial 5.2.2では、下記の通りになっていますが、Bootstrap3では変数名のネーミングが変わっており、このままでは参照できません。

custom.css.scss
color: $grayLight;

解決

公式ドキュメントを見たところ、変数名のネーミングがキャメルケースからチェインケースに変化しておりました。つまり、grayLightgray-lightになっています。

したがって、以下の通りに変更すれば、問題なく参照できます。

custom.css.scss
color: $gray-light;

参考文献

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