formtastic-bootstrap 无法使用 @import 工作?

发布于 2025-01-07 22:15:04 字数 559 浏览 4 评论 0原文

使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野心澎湃 2025-01-14 22:15:04

对不起!当我升级 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文