1
2

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 3 years have passed since last update.

Rails 6でBootstrapをカスタマイズする

Posted at

Theming Bootstrapに書かれているように、Bootstrap 4をカスタマイズ(テーミング)することができる。

環境

  • Rails 6.0.0
  • WebpackでBootstrap 4を管理
  • SCSSを使用

手順

  1. app/assets/stylesheetsbootstrap-custum.scssを作る
  2. app/assets/stylesheets/applications.scss に下のように書く。
applications.scss
@import "bootstrap-custom";
  1. 設定したい事項を書く。
bootstrap-custum.scss
$body-bg: red;

@import 'bootstrap/scss/bootstrap';

Import文はテーミング行の下に書く。

まとめ

これでカスタマイズをすることができる。
Bootstrap Document を見るといろいろあるので、試してみてください。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?