这是我的 application.scss 文件:
@import "bootstrap-sprockets";
@import "bootstrap";
.fav_yes {
color: white;
background-color: red;
}
.navigation {
color:green;
};
然而,当我的 View 中有带有 class="fav_yes"的元素时,我仍然看不到样式化的 html。我试过弄乱分号之类的东西,但没有运气。似乎没有类似的问题提供有效的解决方案。我错过了什么?
最佳答案
从 bootstrap-saas git-hub 上写:
If you have just generated a new Rails app, it may come with a .css file instead. If this file exists, it will be served instead of Sass, so rename it:
我还有一个 application.css 文件,所以 .scss 被覆盖了。我只是将 .scss 的内容复制并粘贴到 .css 中,删除了 .scss 文件并将 .css 文件重命名为 .scss。
关于css - Rails : Assets/stylesheets/application. scss 格式未应用于 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34146584/