Using bootstrap.build has been a smooth experience for customizing Bootstrap 5 so far. However, when I switched to a React project, things started going wrong. The text inside the buttons turned black and the outline button had the same issue on hover.
https://i.sstatic.net/y5sLT.png
https://i.sstatic.net/R450M.png
https://i.sstatic.net/PM5eN.gif
I customized the .scss
file like this:
$orange: #e84c22;
$primary: $orange;
@import "~bootstrap/scss/bootstrap.scss";
However, changing the #e84c22
color for the buttons to display white text using btn btn-outline-primary
and btn btn-primary
classes did not work as expected, even after adjusting $yiq-contrasted-threshold
.
I'm curious about the difference between using Bootstrap in React and through bootstrap.build. What could be happening behind the scenes that is causing this issue?
You can review my example project on codesandbox.io and let me know if you can spot where I went wrong:
https://codesandbox.io/s/sparkling-paper-5tvvc?fontsize=14&hidenavigation=1&theme=dark