Closed carl0zen closed 6 years ago
To provide a bit more context, threw some warnings to try to debug and found that
//buttons.sass line 68
@warn $color-invert
@warn type-of($color-invert)
output:
WARNING: #111
Backtrace:
node_modules/bulma/sass/elements/button.sass:68
WARNING: color
Backtrace:
node_modules/bulma/sass/elements/button.sass:69
WARNING: #fff
Backtrace:
node_modules/bulma/sass/elements/button.sass:68
WARNING: color
Backtrace:
node_modules/bulma/sass/elements/button.sass:69
WARNING: #69707a
Backtrace:
node_modules/bulma/sass/elements/button.sass:68
WARNING: color
Backtrace:
node_modules/bulma/sass/elements/button.sass:69
WARNING: #f5f7fa
Backtrace:
node_modules/bulma/sass/elements/button.sass:68
WARNING: color
Backtrace:
node_modules/bulma/sass/elements/button.sass:69
WARNING: findColorInvert(#1fc8db)
Backtrace:
node_modules/bulma/sass/elements/button.sass:68
WARNING: string
Backtrace:
node_modules/bulma/sass/elements/button.sass:69
Looks like on the last pass the findColorInvert function is not evaluated
This is my webpack.config
var webpack = require('webpack')
var ExtractTextPlugin = require("extract-text-webpack-plugin")
var path = require('path')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var BUILD_DIR = path.resolve(__dirname, 'dist')
var APP_DIR = path.resolve(__dirname, 'src/app')
var GLOBAL_STYLES_DIR = path.resolve(__dirname, 'src/app/styles')
var config = {
entry: [
'webpack-dev-server/client?http://localhost:8080/',
'webpack/hot/only-dev-server',
APP_DIR + '/index.jsx'
],
output: {
path: BUILD_DIR,
publicPath: 'http://localhost:8080/',
filename: 'bundle.js'
},
resolve: {
extensions: ['', '.js', '.jsx', '.scss', '.html', '.css'],
modulesDirectories: ['node_modules', 'src'],
},
resolveLoader: {
modulesDirectories: [
'node_modules'
]
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
include: APP_DIR,
loader: 'react-hot!babel?presets[]=react&presets[]=es2015&presets[]=stage-2',
},
{
test: /\.scss$/,
loaders: ["style", "css?modules&importLoaders=2", "sass", "bulma?theme="+ APP_DIR + '/styles/bulma.scss']
},
{
test: /\.cssm$/,
loaders: ['style', 'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]', 'autoprefixer', 'sass']
},
{
test: /\.css$/,
loaders: ['style', 'css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]']
}
]
},
plugins: [
new ExtractTextPlugin("bundle.css", {
disable: false,
allChunks: true
}),
new HtmlWebpackPlugin({
filename: "index.html",
template: "src/index.html"
}),
new webpack.HotModuleReplacementPlugin()
],
devtool: "cheap-inline-source-map"
};
module.exports = config;
Thanks in advance
Tengo el mismo problema
Error: $color: "findColorInvert(#daf279)" is not a color for `darken' on line 68 of /Users/gcorredor/reiki-escuela/sass/elements/button.sass from line 12 of /Users/gcorredor/reiki-escuela/sass/style.sass Use --trace for backtrace.
I'll look into this and see if it's possible to work around it.
@stipsan any progress on this? Running into this error as well.
Also have this problem.
me too.
Hi all, I got this to finally build and maybe it will help someone else. The docs show importing Bulma like so
// Import Bulma's initial variables
@import "bulma/sass/utilities/variables.sass"
// override examples...
@import "bulma"
bulma.sass loads the variables automatically so I left them out altogether and linked directly to the bulma.sass file. This builds for me.
// over rides here
// import bulma
@import "node_modules/bulma/bulma.sass";
To help anyone who didn't quite understand (me for about 20mins):
Instead of importing variables at the beginning, and then the rest of bulma at the bottom, just include bulma.sass at the top. This will include all the variables so you can edit/override them.
Do not bother adding another import to the bottom, as it will throw errors.
I just figured this out for myself. The problem is, that you need to
@import "bulma/sass/utilities/_all.sass";
instead of
@import "bulma/sass/utilities/variables.sass";
which instantly solves all problems.
This works:
// Import Bulma's initial variables
@import "bulma/sass/utilities/_all.sass";
// Override initial variables here
// You can add new ones or update existing ones:
$blue: #72d0eb; // Update blue
$pink: #ffb3b3; // Add pink
$family-serif: "Georgia", serif; // Add a serif family
// Override generated variables here
// For example, by default, the $danger color is $red and the font is sans-serif
// You can change these values:
$danger: $orange; // Use the existing orange
$family-primary: $family-serif; // Use the new serif family
@import "bulma/bulma";
I tried to overwrite bulma vars using the solution mentioned by @Ra1d3n and @octoshrimpy
App.vue
<style lang="sass">
@import '~bulma/sass/utilities/_all.sass'
$primary: #ff0000 !default
@import '~bulma/bulma.sass'
</style>
While this does not throw any errors on compilation it also does not change the primary color to red. Any suggestions how to overwrite the variables?
@futurmat Why would you set your override to default? Please remove !default
and try again.
I realized that my proposed solution did work for overriding, but could not actually utilize pre-defined variables. I have no idea as to why that is. Right now, my solution is simply this:
$primary: #000;
@import "bulma/bulma";
So, I think I resolved it. The latest version of Bulma uses !default for the variables. Apparently if so it is enough to do it like this:
<style lang="sass">
$primary: #EC8123
@import '~bulma/bulma.sass'
</style>
Using @import '~bulma/sass/utilities/_all.sass'
before won't work!
Are the docs here on github? We should make a PR to edit them if so. It took a bit of searching to figure this out, it would be super easy to make the amend.
So I'm trying to implement this into my own setup without your loader but I don't get my text colours recalculated
Meaning: if I use a super light primary colour, my text loses legibility
@Musmula what does your css/sass look like? can you use/set $primary
?
If you set $primary
, just use $primary-invert
and it should work. Otherwise, use findColorInvert($color)
.
Yep, you're right. I ended up importing the functions file and setting the primary invert
Thx
For Rails, this worked:
// application.scss
$green: #007f40;
$primary: $green;
@import "bulma.sass";
for v0.4.3
+ findColorInvert()
<style lang="sass">
@import "../node_modules/bulma/sass/utilities/initial-variables"
@import "../node_modules/bulma/sass/utilities/functions"
$primary: #6d8acc
$primary-invert: findColorInvert(#6d8acc)
@import "../node_modules/bulma/bulma"
</style>
Hi, first of all thanks for the work on this loader, I think it's great, haven't been able to get it working because of a very common problem with css-modules.
Apparently it parses all color values to strings which get in the way while trying to perform sass color conversions.
This is the error I am getting while trying to execute the example in the README
Any idea how to solve this problem?
Thanks in advance