如何在ActiveAdmin中实际更改变量和覆盖样式?

时间:2013-12-13 20:37:38

标签: ruby-on-rails sass asset-pipeline activeadmin

我偶然发现了这个问题:https://github.com/gregbell/active_admin/blob/master/app/assets/stylesheets/active_admin/mixins/_variables.css.scss

在ActiveAdmin为app/assets/stylesheets生成的https://github.com/gregbell/active_admin/blob/master/lib/generators/active_admin/assets/templates/active_admin.css.scss中,我能够看到更改$sidebar-width: 242px;并且它会做出反应,但如果我尝试添加任何其他来自https://github.com/gregbell/active_admin/blob/master/app/assets/stylesheets/active_admin/mixins/_variables.css.scss的变量只是忽略了对这些变量的更改。例如,以下代码不会使bg颜色变黑...

// SASS variable overrides must be declared before loading up Active Admin's styles.
//
// To view the variables that Active Admin provides, take a look at
// `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the
// Active Admin source.
//
// For example, to change the sidebar width:
$sidebar-width: 500px; // works
$body-background-color: #000; // doesn't work

我真的不知道该怎么做。提前谢谢。

1 个答案:

答案 0 :(得分:0)