Conversation
|
Nit, you want to add You can also run |
76ef20e to
440d165
Compare
440d165 to
56fc702
Compare
Goodwine
left a comment
There was a problem hiding this comment.
LGTM but I'll leave it to Jen to do a final approval.
Note that if you get an approval, you should not submit until both PRs are approved since they should be merged roughly at the same time.
There was a problem hiding this comment.
Looking at the spec (both ours and the CSS spec), I realize now that I mistakenly had the impression (and then shared that with you) that these new math functions have to be contained within another calc to work (MDN was unhelpful here its examples for sqrt and most of the other functions did have them nested).
In actuality, code like
a {
b: sqrt(4);
}is valid and the sqrt(4) should simplify to 2.
Given that, most of these tests should just have sqrt without a calc wrapping them (maybe have one test like that to test the nesting). They otherwise look good (though I'll wait to give final approval until all of the functions are implemented/tested).
Sorry for the confusion!
56fc702 to
13e578c
Compare
13e578c to
d787dea
Compare
85c6a49 to
d24402a
Compare
26db9d2 to
05bcabe
Compare
7c34cc9 to
78b4756
Compare
78b4756 to
e2b967d
Compare
| <===> | ||
| ================================================================================ | ||
| <===> error/no_args/input.scss | ||
| a {b: round()} | ||
|
|
||
| <===> error/no_args/error | ||
| Error: Missing argument $number. | ||
| ,--> input.scss | ||
| 1 | a {b: round()} | ||
| | ^^^^^^^ invocation | ||
| ' | ||
| ,--> sass:math | ||
| 1 | @function round($number) { | ||
| | ============== declaration | ||
| ' | ||
| input.scss 1:7 root stylesheet | ||
|
|
||
| <===> | ||
| ================================================================================ | ||
| <===> error/too_many_args/input.scss | ||
| a {b: round(1, 2, 3, 4)} | ||
|
|
||
| <===> error/too_many_args/error | ||
| Error: Only 1 argument allowed, but 4 were passed. | ||
| ,--> input.scss | ||
| 1 | a {b: round(1, 2, 3, 4)} | ||
| | ^^^^^^^^^^^^^^^^^ invocation | ||
| ' | ||
| ,--> sass:math | ||
| 1 | @function round($number) { | ||
| | ============== declaration | ||
| ' | ||
| input.scss 1:7 root stylesheet |
There was a problem hiding this comment.
It might actually make more sense to pull all the error tests into their own directory to begin with rather than separating them out by number of arguments first.
Context: Calc functions proposal
[skip dart-sass]