This is about the Bulma Docs.
I'm using Bulma with React & GatsbyJS, and I'm having some trouble adjusting the base typography.
Based off the Netlify CMS starter, I have a sass file with the following:
@import "~bulma/sass/utilities/initial-variables"
// insert custom styles...
@import "~bulma"
The Sass file is then imported into layouts/index to serve the styles globally. As far as I can tell that should the correct way to override bulma vars in this setup, but it only appears to work for some things:
// works
$tomato: tomato
$tomato-invert: #fff
$primary: $tomato
$link: $tomato
$primary-invert: $tomato-invert
// does not work
$widescreen-enabled: false
$fullhd-enabled: false
body
font-size: 24px // style rule appears below the original one, see screenshot
So my questions are:
What is the best way to override _all_ bulma base styles?
Specifically,
// Typography
@import url('https://fonts.googleapis.com/css?family=Oleo+Script:300,400,700')
$family-serif: 'Oleo Script', 'Helvetica', 'serif'
.content h1,
.content h2,
.content h3,
.content h4
font-family: $family-serif
There鈥檚 a variable for the body font size. It鈥檚 set to 1rem so you could also change the html font size.
For the content headings there鈥檚 a variable for the weight but not the family.
Thanks for getting back to me. Do you think the package could include a variable for the family?
And also, do you think it would be a good idea to extend the documentation on typography a little? I see that I'm not the first to bring up this issue, and it may save future confusion.
Great framework btw 馃檪
Yes, absolutely. Additional variables for customization are always welcome.
Same for the docs! Feel free to make them clearer.
I have the same kind of problem:
@import url('https://fonts.googleapis.com/css?family=Nunito');
@import "../node_modules/bulma/sass/utilities/initial-variables";
$family-sans-serif: 'Nunito', sans-serif;
$family-monospace: 'Nunito', sans-serif;
My css generated from sass never take those font change. And there is like no documentation about how to change the font base.
@gamugamu You may set $body-family directly instead the $family-sans-serif, didn't know why this work even though $body-family should have same value as $family-sans-serif.
Thanks for this @adakbar. Still failing to work when setting $family-sans-serif directly
@drdreo
This is a response to a year old comment, BUT for seekers of mysterious CSS issues using this starter (and others), I think I discovered the issue on my end. I am using the same Gatsby starter.
It has to do with PurgeCSS plugin. It can remove CSS that is used at build time. See the documentation for more information on whilelisting selectors, etc.
https://www.gatsbyjs.org/packages/gatsby-plugin-purgecss/
This is not a bulma issue.
Most helpful comment
Thanks for getting back to me. Do you think the package could include a variable for the family?
And also, do you think it would be a good idea to extend the documentation on typography a little? I see that I'm not the first to bring up this issue, and it may save future confusion.
Great framework btw 馃檪