-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Fix sass division deprecation #17940
Conversation
Thanks. Can't merge, this should be fixed upstream |
btw this change will affect node-sass compatibility (and break a lot of setups), ref: twbs/bootstrap#34051 For the moment, I suggest this: twbs/bootstrap#34051 (comment) |
Thanks @rafaelmaeuer for the report and PR. But as @tagliala we'll have to consider this one more carefully. We want to support both node-sass and sass (Dart version). So this will take some careful thought. We're working on it. |
@robmadole Isn't node-sass deprecated? (source: https://www.npmjs.com/package/node-sass => https://sass-lang.com/blog/libsass-is-deprecated) |
@rafaelmaeuer @robmadole I think changing the division to multiplication by decimals would also solve the deprecation while maintaining node-sass compatibility, i.e. no need to use the dart-sass specific For example, just change |
@wunc thanks, this is a really nice suggestion, I do prefer multiplication instead of division in general. I will update my PR regardingly. |
@rafaelmaeuer no need to update the PR. The files for this repository are built using something else. We can't merge your changes. |
Could take the same approach angular took by adding a polyfill, something like this:
angular/components@a4043f4#diff-4b0d3692fae1e26970f5365a78db4ff81acb362f79ef12252081df8b285d38e8 |
Does this work on libsass and ruby sass? I've tried on https://www.sassmeister.com/ against libsass 3.5.5 and it doesn't |
hmmm your right, it doesn't work with libsass, looks like its a dartsass polyfill. But libsass is deprecated, that being said, updating to dartsass is not hard at all, it should be a 1 - 1 API and most major loaders/packages support dartsass now. It may break some setups, but thats what comes with updating packages. Why support libsass when its been deprecated sense October (and ruby-sass in March of 2019). |
@nurdism yes, we know, but we would like to preserve the compatibility. I would go for multiplications instead of divisions. In the upstream repository we have some complex mixins, but it looks to me that the output scss only contains 3 divisions The only problematic division may be 4/3, but for the moment I would personally prefer to write |
The Bootstrap Team eventually re-implemented the division: twbs/bootstrap#34245 I think it is too much for FA's specific use case ( |
For those of us older and apparently not hip enough developers, what does "fixed upstream" mean? |
Hi @illdave , this repository contains the code produced in a private repo responsible of building both Font Awesome Free and Pro. What you see here is the result of a building process and any changes done to this repo will be lost, so we need to fix this issue in another repository |
Could we have at least the flag activated to reduce the noise in the logs ? #17940 (comment) |
Just curious if there is any progress here in the meanwhile? Is there already an ETA for a fix in upstream? |
Hi,
Nope sorry
No ETA yet, all the efforts are directed towards FA6 at the moment |
It may be useful to some people. You can patch the files on the fly with @wunc idea (multiplication instead of division).
diff --git a/node_modules/@fortawesome/fontawesome-free/scss/_larger.scss b/node_modules/@fortawesome/fontawesome-free/scss/_larger.scss
index 27c2ad5..540612f 100644
--- a/node_modules/@fortawesome/fontawesome-free/scss/_larger.scss
+++ b/node_modules/@fortawesome/fontawesome-free/scss/_larger.scss
@@ -3,8 +3,8 @@
// makes the font 33% larger relative to the icon container
.#{$fa-css-prefix}-lg {
- font-size: (4em / 3);
- line-height: (3em / 4);
+ font-size: (4em * 0.3333333);
+ line-height: (3em * 0.25);
vertical-align: -.0667em;
}
diff --git a/node_modules/@fortawesome/fontawesome-free/scss/_list.scss b/node_modules/@fortawesome/fontawesome-free/scss/_list.scss
index 8ebf333..f78c1ca 100644
--- a/node_modules/@fortawesome/fontawesome-free/scss/_list.scss
+++ b/node_modules/@fortawesome/fontawesome-free/scss/_list.scss
@@ -3,7 +3,7 @@
.#{$fa-css-prefix}-ul {
list-style-type: none;
- margin-left: $fa-li-width * 5/4;
+ margin-left: $fa-li-width * 1.25;
padding-left: 0;
> li { position: relative; }
diff --git a/node_modules/@fortawesome/fontawesome-free/scss/_variables.scss b/node_modules/@fortawesome/fontawesome-free/scss/_variables.scss
index 68a0750..2150342 100644
--- a/node_modules/@fortawesome/fontawesome-free/scss/_variables.scss
+++ b/node_modules/@fortawesome/fontawesome-free/scss/_variables.scss
@@ -9,7 +9,7 @@ $fa-version: "5.15.3" !default;
$fa-border-color: #eee !default;
$fa-inverse: #fff !default;
$fa-li-width: 2em !default;
-$fa-fw-width: (20em / 16);
+$fa-fw-width: (20em * 0.0625);
$fa-primary-opacity: 1 !default;
$fa-secondary-opacity: .4 !default;
This will automatically patch the files after a This is a temporary solution. |
as for me copy & paste didn't work, here are the steps to patch it yourself:
Edit: I replaced commands when you want to use patch-package with docker in prod builds |
I'm sorry, but 1/3 is not worth 0.3333333. You must use math.div (1, 3) instead
|
@mletoullec you can use Otherwise, you can use |
Alright, folks. We are going to follow Bootstrap on this one and implement a |
Awesome. Font Awesome.
|
This is an older question, but for anyone still struggling with the deprecation noise, with Dart Sass you can add the "--quiet" option and the deprecation warning will be suppressed. |
Please backport fixes to FA 4 |
A fix was released with 6.0.0-beta2. |
Thanks for adding this to the 6.0.0-beta2 release! Are there still plans to add this to 5? @jasonlundien @robmadole |
@bobbyg603 we will release this for 5 but right now we are hyper-focused on 6. So I don't have a schedule for a 5 release at the moment. |
@robmadole totally understand, thanks for the heads up! |
+1 for seeing this backported to 5 @robmadole |
SassError: Undefined operation "2em * fa-divide(5, 4)" Using nextjs default sass compiler, any ideas? |
I understand that:
I understand that it will not be merged and I will not be listed as a contributor on this project.
This PR fixes the outstanding deprecation of
/
division which will be removed in Dart Sass 2.0.0.Building this package with webpack gives the following warning when using sass ^1.33.0:
The changes made in this PR conform to the sass deprecation guide:
https://sass-lang.com/documentation/breaking-changes/slash-div