-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Getting sass error when including bulme. Using adonuxt. #1670
Comments
I am having the same issue. Note, It is only a warning, you can just ignore it because the generated css is correct anyway. As bulma@0.5.2 uses css variables, PostCSS tries to parse them as However, it will be nice if someone experienced with PostCss tells us if some configuration can fix the warning, @alanaasmaa. |
@motia Yes i ignored it for now after googled many hours. |
@alanaasmaa @motia I found the solution. This works for me. build: {
postcss: {
plugins: {
'postcss-custom-properties': false
}
}
} ref |
@RyosukeCla , that is it, thanks a lot. |
It's also possible to turn off value warnings (whatever those are) and only show error warnings -- as mentioned here: https://github.com/postcss/postcss-custom-properties#novaluenotifications. I believe that should solve the Bulma problem while still being of benefit if you try to use an undefined variable. However, I couldn't figure out how to get it to work. I tried this and it did not work:
If someone else knows how to get it to work, I'd appreciate it if they could post the code. |
What about this postcss: {
plugins: {
'postcss-custom-properties': {
warnings: false
}
}
}, |
so is it a bug on bulma side? :/ |
There is a closed issue about this here: jgthms/bulma#1190 I'm not actually using postcss on my project, so adding the above code snippets to turn warnings off results in a fatal compile error for dependencies. |
RyosukeCla's post saved the day for me. In my case, it wasn't just warning messages. My bulma components were not rendering. A huge thanks to RyosukeCla. |
Fix - 'postcss-custom-properties': false - nuxt/nuxt#1670 (comment)
@RyosukeCla For me not work. My Css looks like this: in /*
** Global CSS
*/
css: ['~/assets/style/src/main.scss'], This // BULMA utilities
@import '../../../node_modules/bulma/sass/utilities/all';
// Theming
@import './css-vars';
@import './theme-vars';
// Bases
@import '../../../node_modules/bulma/bulma';
@import '../../../node_modules/buefy/src/scss/buefy'; The .is-primary {
background-color: var(--primary);
}
// or with fallback
.is-primary {
background-color: var(--primary, #7957d5);
} Current output (unwanted): .is-primary {
background-color: #7957d5;
} My const pkg = require('./package')
const purgecss = require('@fullhuman/postcss-purgecss')
const postcssCustomProps = require('postcss-custom-properties')
module.exports = {
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#FFFFFF' },
/*
** Global CSS
*/
css: ['~/assets/style/src/main.scss'],
/*
** Plugins to load before mounting the App
*/
plugins: ['@/plugins/buefy'],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://github.com/nuxt-community/axios-module#usage
'@nuxtjs/axios'
],
/*
** Axios module configuration
*/
axios: {
// See https://github.com/nuxt-community/axios-module#options
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extractCSS: true,
extend(config, ctx) {
// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
},
postcss: {
plugins: [
purgecss({
content: [
'./pages/**/*.vue',
'./layouts/**/*.vue',
'./components/**/*.vue'
],
whitelist: ['html', 'body'],
whitelistPatterns: [/nuxt-/]
}),
postcssCustomProps({
warnings: false,
preserve: true
})
]
}
}
} The Would anyone know how to give me a way to solve this and keep the css variables in the final css file? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi, I cant figure out why i'm gettin this error, i even tryed to import it old fashioned way.
my nuxt cnf
The text was updated successfully, but these errors were encountered: