Rails / Zurb Foundation TopBar - 无法更改链接/按钮背景颜色

时间:2016-01-12 15:35:33

标签: css ruby-on-rails sass zurb-foundation zurb-foundation-5

我试图更改Rails应用中顶部栏的颜色。我已经修改了foundation_and_overrides.scss并且可以成功更改主要的topbar背景。但按钮和链接仍保留默认黑色。这是文件的相关部分。

有人可以告诉我我错过了什么吗?

green

更新 我编辑了     Ruby21 \ LIB \红宝石\宝石\ 2.1.0 \宝石\基础护栏-5.5.2.1 \供应商\资产\样式表\基础\ components_top,bar.scss 文件,看看会发生什么。链接的bg颜色变为白色(#FFFFFF)。为什么lib文件有效,本地文件没有?

red

2 个答案:

答案 0 :(得分:0)

试试这个:

$topbar-link-bg: $topbar-bg-color;

答案 1 :(得分:0)

我明白了。问题出在我的application.sccs文件中。

/*
 * 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 bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any styles
 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
 * file per style scope.
 *
 *= require_tree .
 *= require_self
 */
 @import "foundation_and_overrides";

我删除了' require_tree。'并添加了'需要foundation_and_overrides'

这是有效的文件:

/*
 * 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 bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any styles
 * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
 * file per style scope.
 *
 *= require foundation_and_overrides
 *= require_self
 */

在我树中的一个SCSS文件中,我重新导入了:

@import"基础/组件/按钮&#34 ;;