formtastic-bootstrap 无法使用 @import 工作?
使用Rails 3.2尝试twitter bootstrap并将formtastic-bootstrap与这些gem一起使用,因为我发现推荐的
gem'formtastic',git:'git://github.com/justinfrench/formtastic.git',branch:'2.1-stable' gem 'formtastic-bootstrap', git: 'git://github.com/cgunther/formtastic-bootstrap.git', Branch: 'bootstrap2-rails3-2-formtastic-2-1'
如果我在清单中需要它们application.css 然后它们工作并且表单获取 twitter 样式,但是我想覆盖一些颜色,所以我知道我需要使用 @import 这样我可以覆盖 $ vars。所以我把它放在清单
@import 'twitter/bootstrap' 之后的 application.css; @import 'formtastic-bootstrap.css';
我可以看到浏览器已获取这些文件,但未应用样式,
我错了什么?
Using Rails 3.2 trying twitter bootstrap and using formtastic-bootstrap with these gems as I found recommended
gem 'formtastic', git: 'git://github.com/justinfrench/formtastic.git', branch: '2.1-stable'
gem 'formtastic-bootstrap', git: 'git://github.com/cgunther/formtastic-bootstrap.git', branch: 'bootstrap2-rails3-2-formtastic-2-1'
If I require them in the manifest in application.css then they work and forms get the twitter styles however I want to override some of the colours so I know I need to use @import so I can override the $ vars.So I have put this in application.css after the manifest
@import 'twitter/bootstrap';
@import 'formtastic-bootstrap.css';
I can see these files have been got by the browser but the styles are not being applied
What am I getting wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对不起!当我升级 Rails 3.1 应用程序时,我没有看到 application.css 是 application.css 而不是 application.css.scss!我的坏!现在 sass 将 @import 视为自己的指令,而不是 css @import,它可以按预期工作。
Sorry! as I was upgrading a rails 3.1 app I did not see that application.css was application.css not application.css.scss! My bad! Now that sass sees the @import as its own instruction and not a css @import it works as expected.