简体   繁体   English

无法加载React-Bootstrap和Bootstrap-sass modal.scss

[英]React-Bootstrap and Bootstrap-sass modal.scss not loading

I have a react application, which uses react-bootstrap + bootstrap-sass. 我有一个React应用程序,它使用react-bootstrap + bootstrap-sass。

I´m loading the bootstrap.scss file in my main app.scss like this: 我正在像这样在我的主app.scss中加载bootstrap.scss文件:

@import '~bootstrap-sass/assets/stylesheets/_bootstrap';

In my page, I implemented a simple Component from React-Bootstrap. 在我的页面中,我实现了一个来自React-Bootstrap的简单组件。

But the modal window has no CSS whatsoever, so it looks really bad. 但是模态窗口根本没有CSS,因此看起来确实很糟糕。

I´ve tried to load the modal.scss directly 我尝试直接加载modal.scss

@import '~bootstrap-sass/assets/stylesheets/bootstrap/_modals';

But still no styles are applied. 但是仍然没有应用任何样式。 (the modal appears and hides as expected though). (模态将按预期方式显示和隐藏)。

Bootstrap scss is loaded though, as the styles on buttons, dropdowns, etc is present. 不过,由于存在按钮,下拉菜单等上的样式,因此会加载Bootstrap scss。

您需要将已编译的CSS导入到其适用的组件JSX文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM