$primary-text-emphasis-dark が undefined エラー
Published: 2023/8/19
Undefined variable. "primary": $primary-text-emphasis-dark
Bootstrap のバージョンを上げたところ、上記のエラーが発生した。
原因
Bootstrap 5.3.0 から、 -dark
系の変数が導入され、それが定義されていないと scss のコンパイルが落ちてしまうのが原因だった。
以下のように、-dark
を import するようにしたところ、解決した。
// 既存
@import "@/node_modules/bootstrap/scss/variables";
// 新規追加。
// -dark 系の変数定義も読み込む
@import "@/node_modules/bootstrap/scss/variables-dark";
参考
Missing $primary-text-emphasis-dark variable · Issue #38683 · twbs/bootstrap
Prerequisites I have searched for duplicate or closed issues I have validated any HTML to avoid common problems I have read the contributing guidelines Describe the issue The problem is your update...
github.com
Tags: bootstrap
関連記事
Bootstrap の scss 変数の依存関係(色とフォントまわり)
2022/5/15
Bootstrap はモバイルを最初に実装すると効率が良さそう。
2021/11/29
自分用 css のレイアウト決定のフローチャート
2021/5/15
素の jekyll に bootstrap 4 を導入するまでにやったこと
2019/2/27