Problem overriding some Bulma Sass variables

坚强是说给别人听的谎言 提交于 2021-01-29 05:39:13

问题


I am trying to customize Bulma by overriding some Sass variables.

In my app.scss file I import the files using the following order:

@import 'node_modules/bulma/sass/utilities/initial-variables';
@import 'node_modules/bulma/sass/utilities/functions';
@import 'bulma_overrides';
@import 'node_modules/bulma/bulma';

The file bulma_overrides.scss includes the following:

$footer-padding: 3rem 1.5rem 3rem;
$footer-background-color: whitesmoke;

My goal was to make the footer a little bit thinner, and I tried to achieve this by changing the padding from 3rem 1.5rem 6rem to 3rem 1.5rem 3rem. At the same time I am changing the backgroud color to whitesmoke.

After running and successfully building:

npm run watch

I reload the page.

Result:

The background color of the footer changes just fine but the padding does not.

At first, I thought that maybe this is not something we can customize, but the official documentation says that we can:

https://bulma.io/documentation/layout/footer/

Any ideas why? By the way, I faced the same issue with another variable in a previous project, and I can't understand what is going on.

PS1: i am using Laravel 5.7 for this project. No changes are done in webpack.mix.js

PS2: i tried multiple browsers (Chrome, Firefox, Safari, Edge[lol]) but no luck.


回答1:


Your bulma import is already importing "sass/utilities/_all", so this app.scss worked for me just fine:

// Bulma Overrides
@import 'bulma_overrides';

// Bulma
@import '~bulma/bulma';


来源:https://stackoverflow.com/questions/53882642/problem-overriding-some-bulma-sass-variables

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