-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Problem with columnGap property #1190
Comments
That's weird. Why does it need to be scoped to |
Seems like this is some https://github.com/postcss/postcss-custom-properties rule - |
There's your problem. It's just a warning though. You can ignore it. |
So I'm seeing this now as well, and it is extremely frustrating to have dozens of warnings pop up at me every time I recompile my code base (which is every time I save any file in my project). Is this closed as a "wont-fix" issue? It seems like the compiler is trying to warn you of a code smell, and simply ignoring it probably isn't wise. |
@emilsgulbis Thanks to your hint to custom-properties I found how to stop postcss from screaming. In postcss.config.js:
|
These warnings are very annoying.. is this a wont fix? |
I'm seeing this too after adding Bulma to an Angular 4/5 CLI project. I can't see an easy way of customising the PostCSS config in Angular CLI. |
More and more people will come here to complain about this issue because angular cli updated their postcss options in 1.5 and now it shows many warnings. There is no way to change angular cli postcss options. Its very easy to fix this, the problem is in grid/columns.sass in the last four lines. The temporary solution i used was remove the |
One last though, its impossible to ignore these warnings, its like 60 lines of warning in your face (console) |
One option is to not include the whole of Bulma in your Angular CLI generated project. Having done $fa-font-path : '../node_modules/font-awesome/fonts';
@import '../node_modules/font-awesome/scss/font-awesome';
@import "~bulma"; Instead of importing the whole of Bulma, I change it to this: $fa-font-path : '../node_modules/font-awesome/fonts';
@import '../node_modules/font-awesome/scss/font-awesome';
@import "~bulma/sass/utilities/_all";
@import "~bulma/sass/base/_all";
@import "~bulma/sass/elements/_all";
@import "~bulma/sass/components/_all";
// @import "~bulma/sass/grid/_all";
@import "~bulma/sass/layout/_all"; And no warnings! Of course you no longer have access to any of the Bulma Grid. |
@matheusdavidson: I guess you could just comment out the whole block.
That's my current work-around as I don't use the is-variable functionality. |
and for those who uses columns like me? =/ |
@stewwan I'm doing this... @import "~bulma/sass/utilities/_all";
@import "~bulma/sass/base/_all";
@import "~bulma/sass/elements/_all";
@import "~bulma/sass/components/_all";
@import "sass/grid/_all";
@import "~bulma/sass/layout/_all"; Where |
hey @darrenmothersele thanks. I'll use this workaround =) |
I've just created a complete replacement for the is-variable option:
|
@stewwan here's another workaround. I created a fork without the
and replace with:
or, if you need the
re-run yarn to get the replacement package. |
Same here when using angular-cli and bulma! @darrenmothersele is there any way to maintain using bulma core but put an fix to this warning withou calling another github account? |
Bulma uses a feature that PostCSS can't transpile for older browsers. You need to add PostCSS configuration to tell it to not generate warnings about this. Angular CLI has no mechanism for overriding/extending the PostCSS configuration. So, you either have to:
or,
There are several ways to achieve (2) in this issue. You can find out how to do (1) at the linked issue in the Angular CLI repo. |
for those people running in this trouble, I'm using a workaround to keep me able maintenance of bulma across multiple projects. while it does not have a better solution on the part of angular-cli you can just npm install --save git://github.com/stewwan/bulma.git happy coding again |
Is this really a wontfix? These warnings are like broken windows. Is there another workaround that doesn't involve ignoring warnings is or commenting out code. |
jgthms#1190 (Emitted value instead of an instance of Error) postcss-custom-properties: /<project-path>/node_modules/bulma/sass/grid/columns.sass:328:6: Custom property ignored: not scoped to the top-level :root element (.columns.is-variable.is-8 { ... --columnGap: ... })
Wow, that bad huh? I'm a Sass noob but I took this as a challenge to learn Sass and came up with this (after a lot of trial and error). It basically does exactly the same thing, but instead of using CSS variables, it uses Sass variables (so the compiled CSS is very basic, doesn't use any variable magic). @crispinheneise here is the workaround. It fully retains the //.columns.is-variable
// --columnGap: 0.75rem
// margin-left: calc(-1 * var(--columnGap))
// margin-right: calc(-1 * var(--columnGap))
// .column
// padding-left: var(--columnGap)
// padding-right: var(--columnGap)
// @for $i from 0 through 8
// &.is-#{$i}
// --columnGap: #{$i * 0.25rem}
@mixin columns-is-variable($columnGap: 0.75rem)
margin-left: #{-1 * $columnGap}
margin-right: #{-1 * $columnGap}
.column
padding-left: $columnGap
padding-right: $columnGap
.columns.is-variable
@include columns-is-variable
@for $i from 0 through 8
&.is-#{$i}
@include columns-is-variable($i * 0.25rem) I think this rewrite is so elegant I want to PR it. But, should I? (EDIT: Done! #1480) (Fun fact: First ever use of @Knacktus the above Sass basically generates what you manually created: /* Generated CSS (truncated for brevity): */
.columns.is-variable {
margin-left: -0.75rem;
margin-right: -0.75rem; }
.columns.is-variable .column {
padding-left: 0.75rem;
padding-right: 0.75rem; }
.columns.is-variable.is-0 {
margin-left: 0rem;
margin-right: 0rem; }
.columns.is-variable.is-0 .column {
padding-left: 0rem;
padding-right: 0rem; }
.columns.is-variable.is-1 {
margin-left: -0.25rem;
margin-right: -0.25rem; }
.columns.is-variable.is-1 .column {
padding-left: 0.25rem;
padding-right: 0.25rem; }
...
.columns.is-variable.is-7 {
margin-left: -1.75rem;
margin-right: -1.75rem; }
.columns.is-variable.is-7 .column {
padding-left: 1.75rem;
padding-right: 1.75rem; }
.columns.is-variable.is-8 {
margin-left: -2rem;
margin-right: -2rem; }
.columns.is-variable.is-8 .column {
padding-left: 2rem;
padding-right: 2rem; } |
Instead of depending on CSS variable browser support, use a Sass variable and a Sass mixin to generate regular CSS for the is-variable class. This should increase browser compatibility as well as fix jgthms#1190 where warnings are emitted when using a CSS variable.
I regret to inform that my PR #1480 was rejected as Bulma project maintainer strongly believes in making use of client-side CSS variables over compile-side Sass variables. In any case, if you want to adopt the Sass-based variation, it's available in my comment above as well as in my fork: https://github.com/ADTC/bulma/tree/issue-1190 |
@ADTC Not happy with this too.. |
Looking into it. I’ll add a flag to enable CSS variables. |
You can now disable this feature by setting |
@jgthms where do I put this? |
@jgthms But what about us who use columns? This doesn't fix anything imho... |
Seems like this isn't implemented yet. |
@jgthms could you push version 0.6.3 to github? |
@Smiley01987 This only affects variable columns. |
Ok since some users are still confused, let me explain. Bulma has a feature called variable gap columns. Here's the source code: @if $variable-columns
.columns.is-variable
--columnGap: 0.75rem
margin-left: calc(-1 * var(--columnGap))
margin-right: calc(-1 * var(--columnGap))
.column
padding-left: var(--columnGap)
padding-right: var(--columnGap)
@for $i from 0 through 8
&.is-#{$i}
--columnGap: #{$i * 0.25rem} This is not the basic Bulma columns, but an experimental feature. It uses CSS Variables. It lives behind the The problem that @emilsgulbis has encountered is with his Webpack setup. Somewhere in his config, he's using the postcss-custom-properties plugin. What this plugin does is try to replace instances of CSS variables (like Anyway, the problem here comes from the The plugins: [
// Specify the resulting CSS filename
new ExtractTextPlugin('css/app.css'),
// Stylelint plugin
new styleLintPlugin({
configFile: '.stylelintrc',
context: '',
files: '**/*.scss',
syntax: 'scss',
failOnError: false,
quiet: false
})
], This transforms all Now, in one of those files, you're importing Bulma. To disable the variable columns, just set $variable-columns: false;
@import "~bulma/bulma"; Before: To summarize, here are your options:
Hope this helps! |
@jgthms thanks for the clarification. the problem now is that version 0.6.3 is not released in github. I remember you said that or it was merged in 0.6.1? |
it's published on 0.6.1, just removed my warnings by setting this variable to false! |
Cool I’ll try |
I tried that exactly as you described, but it works neither with v0.6.1 nor with v0.6.2. |
Here is how I resolved this issue. In my
|
variable solution worked. thanks for the help. $variable-columns: false;
@import '../node_modules/bulma/bulma'; it would be nice if this issue is mentioned within document. It took several time to figure out. |
▼columnGapプロパティの問題・Issue#1190・jgthms / bulma jgthms/bulma#1190 (comment)
- Check this for more info jgthms/bulma#1190 (comment)
Hello Bulma'ers!
Just catched this WARNING message when compiling my Sass with Webpack
(Emitted value instead of an instance of Error) postcss-custom-properties: /<project-path>/node_modules/bulma/sass/grid/columns.sass:328:6: Custom property ignored: not scoped to the top-level :root element (.columns.is-variable.is-8 { ... --columnGap: ... })
The text was updated successfully, but these errors were encountered: