2013-12-09 82 views
0

我最近跑了捆绑安装一个Rails应用程序,里面摆放着红宝石的文件夹在我的供应商文件夹中包含斌,高速缓存,DOC,宝石等Rails的CSS编译

因为这样做,看来我的CSS造型正在陷入冲突。我正在使用bootstrap以及覆盖文件,但是在我的样式混乱的地方,我注意到:在检查元素之前和之后:奇怪的地方。

某些元素似乎失去了他们的造型,但其他人看起来没问题。我猜测我的造型在某处被覆盖,但我不明白它是如何发生的。

任何人都可以请帮助我了解如何解决和避免在将来呢?看起来像我的供应商文件夹可能会重写我实施的样式。清单文件的

我application.css.scss

/* 
* This is a manifest file that'll be compiled into application.css, which will include all the files 
* listed below. 
* 
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 
* 
* You're free to add application-wide styles to this file and they'll appear at the top of the 
* compiled file, but it's generally better to create a new file per style scope. 
* 
*= require_self 
*= require font-awesome 
*= require bootstrap_and_overrides 
*/ 

回答

1

移动require_self最后一行。

+0

我试过这个和相同的结果 - 失去了一些样式。感谢您的建议。 – pvskisteak5

0

左右,基本CSS重写发生这样的

1)最后一个胜 2)更具体的CSS选择器胜(不管它的定义)

所以,如果你做的补丁来引导,确保你把放在之后,你包括bootstrap本身,然后尝试使用更具体的CSS选择器,比如使用你的应用特定的css类名称和类似的东西。