-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bulma SASS variables? #187
Comments
Using Buefy, I managed to do it like that: Create a buefy.js file in the plugins directory: import Vue from 'vue';
import Buefy from 'buefy';
// Volontarily omitted
// import 'buefy/lib/buefy.css';
Vue.use(Buefy); Create an overrides.scss file in the assets directory, and import it in your app.scss file: // Import Bulma's core
@import '~bulma/sass/utilities/initial-variables';
@import '~bulma/sass/utilities/functions';
// OVERRIDES GOES BETWEEN HERE...
// Fonts
@import url('https://fonts.googleapis.com/css?family=Nunito:400,700');
$family-sans-serif: 'Nunito', sans-serif;
// Bulma colors
$primary: #0e637e;
$primary-invert: findColorInvert($primary);
$colors: ('primary': ($primary, $primary-invert));
// ... AND HERE
// Import Bulma and Buefy styles
@import '~bulma';
@import '~buefy/src/scss/buefy'; App.scss @import 'overrides';
// Your custom scss goes there... Then configure nuxt.config.js like that (the post-css options is for removing alerts): build: {
/*
** Run ESLint on save
*/
extend(config, { isDev, isClient }) {
if (isDev && isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/,
});
}
},
vendor: ['buefy'],
postcss: {
plugins: {
'postcss-custom-properties': false,
},
},
},
plugins: ['~/plugins/buefy.js'],
css: [{ src: '~/assets/scss/app.scss', lang: 'scss' }], |
Just wanted to bump this one as I think it might still be an issue. I have a similar file to @VonStruddle's overrides.scss called _bulma.scss and I import is into my main global styles app.scss. I found that Bulma was overriding all my styles and I could not override the Bulma variables no matter what I tried. As soon as I ran
...and removed the '@nuxtjs/bulma' from my modules, everything immediately worked as expected. Could this be a bug with the plugin somehow? |
can confirm ^ Uninstalling |
@wahidrahim thank you for confirming? I wonder if anyone knows of any special reason why - or set-up with which - the plugin should not work. Is the plugin supposed work out of the box or is configuration required? |
How can I override bulma variables without using Buefy? @VonStruddle ? |
make a folder called styles , inside which make an app.scss, add this file to nuxt.config.js under css section as ['~/assets/styles/app.scss'] uninstall nuxt-bulma and install plain bulma with npm i bulma |
For the app with css: [
{ src: 'bulma/bulma.sass', lang: 'sass' },
...
],
styleResources: {
...
sass: ['~assets/css/vars/bulma-overrides.sass']
}, |
I solved it by replacing:
with:
Then in
Also had to reinstall bulma using npm. |
@Ra1phM thanks for sharing! will give that a try next time |
How do you edit your bulma SASS variables in a way that works with nuxt?
The text was updated successfully, but these errors were encountered: