在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
我真的不知道该怎么做。提前谢谢。
答案 0 :(得分:0)
https://github.com/gregbell/active_admin/commit/82402529125764229f5bb851d7b9073ad78eb536添加了使用SASS !default
设置变量覆盖的功能,但自那时起一直没有添加!default
的提交,即来自https://github.com/gregbell/active_admin/commit/de62b3d7a68fc82f980a723f014ba844a635bea9
我刚刚在master上更新了这些变量:https://github.com/gregbell/active_admin/commit/26d9b741ddb9176a8239f7508da508fccdbd8332