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

Fix a bunch of small spec incompatibilities in built-in functions #750

Merged
merged 13 commits into from
Jul 4, 2019

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Jul 3, 2019

@nex3 nex3 requested a review from nshahan July 3, 2019 00:39
if (arguments[0] is SassNumber) {
if (weight.value != 100 || !weight.hasUnit("%")) {
Copy link
Contributor

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%);?

Copy link
Contributor Author

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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@nex3 nex3 merged commit 5259589 into master Jul 4, 2019
@nex3 nex3 deleted the function-fixes branch July 4, 2019 00:55
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

Successfully merging this pull request may close these issues.

None yet

2 participants