-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See sass/sass#3989
- Loading branch information
Showing
1 changed file
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<===> README.md | ||
Most of the same behavior tested for `calc()` applies to `calc-size()`, but for | ||
terseness' sake isn't tested explicitly. | ||
|
||
<===> | ||
================================================================================ | ||
<===> one_arg/input.scss | ||
a {b: calc-size(var(--foo))} | ||
|
||
<===> one_arg/output.css | ||
a { | ||
b: calc-size(var(--foo)); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> unsimplified/input.scss | ||
a {b: calc-size(auto, 5% - 20px + size)} | ||
|
||
<===> unsimplified/output.css | ||
a { | ||
b: calc-size(auto, 5% - 20px + size); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> simplified/input.scss | ||
a {b: calc-size(auto, 100px - 20px + size)} | ||
|
||
<===> simplified/output.css | ||
a { | ||
b: calc-size(auto, 80px + size); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> case_insensitive/input.scss | ||
a {b: CaLc-size(auto, size - 20px)} | ||
|
||
<===> case_insensitive/output.css | ||
a { | ||
b: calc-size(auto, size - 20px); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> overridden/input.scss | ||
@function calc-size($arg) {@return $arg} | ||
a {b: calc-size(1)} | ||
|
||
<===> overridden/output.css | ||
a { | ||
b: 1; | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> error/too_few_args/input.scss | ||
a {b: calc-size()} | ||
|
||
<===> error/too_few_args/error | ||
Error: Missing argument. | ||
, | ||
1 | a {b: calc-size()} | ||
| ^^^^^^^^^^^ | ||
' | ||
input.scss 1:7 root stylesheet | ||
|
||
<===> | ||
================================================================================ | ||
<===> error/too_many_args/input.scss | ||
a {b: calc-size(auto, 0, 0)} | ||
|
||
<===> error/too_many_args/error | ||
Error: Only 2 arguments allowed, but 3 were passed. | ||
, | ||
1 | a {b: calc-size(auto, 0, 0)} | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
' | ||
input.scss 1:7 root stylesheet | ||
|
||
<===> | ||
================================================================================ | ||
<===> error/syntax/invalid_arg/input.scss | ||
a {b: calc-size(auto, $)} | ||
|
||
<===> error/syntax/invalid_arg/error | ||
Error: Expected identifier. | ||
, | ||
1 | a {b: calc-size(auto, $)} | ||
| ^ | ||
' | ||
input.scss 1:24 root stylesheet | ||
|
||
<===> | ||
================================================================================ | ||
<===> error/sass_script/input.scss | ||
a {b: calc-size(auto, 7 % 3)} | ||
|
||
<===> error/sass_script/error | ||
Error: This operation can't be used in a calculation. | ||
, | ||
1 | a {b: calc-size(auto, 7 % 3)} | ||
| ^ | ||
' | ||
input.scss 1:25 root stylesheet |