-
Notifications
You must be signed in to change notification settings - Fork 349
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 a bunch of small spec incompatibilities in built-in functions #750
Conversation
if (arguments[0] is SassNumber) { | ||
if (weight.value != 100 || !weight.hasUnit("%")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these checks allow for calling the CSS function invert(70%);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes; weight
here is the second argument, so as long as it's the default value, any number is allowed for the first argument.
@@ -47,16 +47,20 @@ final global = UnmodifiableListView([ | |||
} | |||
}), | |||
|
|||
BuiltInCallable("invert", r"$color, $weight: 50%", (arguments) { | |||
BuiltInCallable("invert", r"$color, $weight: 100%", (arguments) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you consider this a breaking change to alter the default value of weight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because previously this had a special case for $weight: 50%
where it treated it as though the weight was 100%
😝. We removed that special case, but actually calling invert()
with one argument still works the same as it always did.
See sass/sass-spec#1424