How to customize bulma variables in rails

独自空忆成欢 提交于 2019-12-03 17:00:00

Ok managed to get this working.

I created a file called application.css.scss in the app/assets/stylesheets directory and added the following:

$blue: #72d0eb;
$pink: #ffb3b3;
$pink-invert: #fff;
$family-serif: "Merriweather", "Georgia", serif;
$primary: $pink;
$primary-invert: $pink-invert;
$family-primary: $family-serif;

@import "bulma";

This works just fine. Adding the initial import statement causes to fail though, played around with it a bit trying to get the path correct but it always failed for me. Not sure if this has any significance I'm not seeing but works for me now anyways.

In my case, application.css was already existing, and following looneym's answer didn't work. Turns out, I just had to rename "application.css" to "application.css.scss", and then I could change some of the variables as follows:

/* Use Bulma for styling */
$green: #00E676;
$primary: $green;
@import "bulma";

To do this in RubyMine, just right click the file in the tree, select "refactor" and then "rename".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!