Skip to content
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

Mixins.scss uses un-imported variables. #2773

Closed
Didel opened this issue Jan 17, 2020 · 14 comments
Closed

Mixins.scss uses un-imported variables. #2773

Didel opened this issue Jan 17, 2020 · 14 comments

Comments

@Didel
Copy link

Didel commented Jan 17, 2020

This is about Bulma.

Overview of the problem

This is about the Bulma CSS framework
I'm using Bulma version 0.8.0
This is a Sass issue.
I am almost sure this issue is not a duplicate.

Description

Utilities/mixins.scss includes@import "initial-variables" in order to resolve the variables used in the various defined mixins. However, version 0.8.0 includes a mixin (=delete) that makes use of the $scheme-invert variable, while it is not specified in the included initial-variables.scss .

This will cause a problem if you only import the mixins, because the $scheme-invert variable will be undefined.

Steps to Reproduce

  • Create a new .scss file
  • Import the mixins.scss from Bulma (e.g. @import "./node_modules/bulma/sass/utilities/mixins";)
  • compile the .scss file you created above.

Expected behavior

No compilation errors.

Actual behavior

I got a compiler error:

{
  "status": 1,
  "file": "../node_modules/bulma/sass/utilities/mixins.sass",
  "line": 173,
  "column": 26,
  "message": "Undefined variable: \"$scheme-invert\".",
  "formatted": "Error: Undefined variable: \"$scheme-invert\".\n        on line 173 of node_modules/bulma/sass/utilities/mixins.sass, in mixin `delete`\n        from line 236 of node_modules/bulma/sass/utilities/mixins.sass\n        from line 1 of src/base/mixins.scss\n        from line 4 of src/base/all.scss\n>>   background-color: rgba($scheme-invert, 0.2);\n\n   -------------------------^\n"
}
@Didel
Copy link
Author

Didel commented Jan 17, 2020

I have created Pull-Request #2774 that will fix this issue.

@crabnky
Copy link

crabnky commented Mar 4, 2020

Have the same - when can I expect fix to be released?

@dicren
Copy link

dicren commented Mar 30, 2020

Meanwhile I fix it importing all the files that are necessary

@import "~bulma/sass/utilities/functions";
@import "~bulma/sass/utilities/initial-variables";
@import "~bulma/sass/utilities/derived-variables";
@import "~bulma/sass/utilities/mixins";

@gonzofish
Copy link

@dicren I believe initial-variables is already imported into mixins

@CallumWatkins
Copy link

@dicren I believe initial-variables is already imported into mixins

derived-variables also requires initial-variables to be imported first, regardless of mixins.

@gonzofish
Copy link

Ah, right, @CallumWatkins, good point!

@Didel
Copy link
Author

Didel commented Apr 2, 2020

@dicren I believe initial-variables is already imported into mixins

derived-variables also requires initial-variables to be imported first, regardless of mixins.

@gonzofish Exactly, that is why in #2774 I've also added the derived-variables import to mixins.sass. This way, you can choose to only import mixins.sass without having to worry about importing other dependencies.

simonwinter added a commit to salted-herring/saltedherring-vue that referenced this issue May 11, 2020
* Newer webpack interfering with chunk names.
* Until bulma error is resolved, we must override the mixins jgthms/bulma#2773
@stale
Copy link

stale bot commented Oct 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 2, 2020
@Didel
Copy link
Author

Didel commented Oct 2, 2020

I don’t agree with the Stale bot. As the PR hasn’t been merged yet, it should not be closed.

@stale stale bot removed the stale label Oct 2, 2020
@Artem-Schander
Copy link

It takes almost four years to fix this issue?

@jgthms jgthms closed this as completed Nov 10, 2020
@Didel
Copy link
Author

Didel commented Nov 11, 2020

It takes almost four years to fix this issue?

@Artem-Schander I don’t know what you mean, this ticket was created in January of this year.

@jgthms what a great way to show how thankful you are to people who contribute. After 10 months of (seeming) inactivity, you close the issue by ignoring the created PR, and instead create a commit of your own without any credit to someone who has supplied (part of) the solution. Then you continue to close this ticket without any message, at least a simple ‘thank you for your contribution’ would have been nice.

If it takes 10 months to look into a change of 1 line of scss, together with what I said in the lines above, that does raise serious questions about the state of the project and its maintainers. The open source community is a wonderful community, but if you treat them like this, don’t expect people to actively contribute in the future any more.

@Artem-Schander
Copy link

@Didel You‘re right. My bad. I‘ve seen the 17 and thought, what a long time.
However, 10 months is a long time for this kind of issue as well.
I subscribed to this issue a long time ago and would like to see the PR merged or the issue resolved. It sucks that i can not use the scss for the newer stuff.

@dbryar
Copy link

dbryar commented Dec 29, 2020

Latest NPM package (0.9.1) still does not have this issue fixed so the build fails in a TypeScript VueJS app without the PR included.

@alexd73
Copy link

alexd73 commented Mar 7, 2021

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch bulma@0.9.1 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/bulma/sass/utilities/mixins.sass b/node_modules/bulma/sass/utilities/mixins.sass
index 0ed78c1..7c5ee20 100644
--- a/node_modules/bulma/sass/utilities/mixins.sass
+++ b/node_modules/bulma/sass/utilities/mixins.sass
@@ -1,4 +1,5 @@
 @import "initial-variables"
+@import "derived-variables"
 
 =clearfix
   &::after

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants