<===> number/unitless/input.scss
$result: inspect(123.456);
a {
value: $result;
type: type-of($result);
}
<===> number/unitless/output.css
a {
value: 123.456;
type: string;
}
<===>
================================================================================
<===> number/unit/input.scss
// We explicitly don't test the inspect format for complex units. Their format
// isn't guaranteed by the spec, since they can't be written literally in Sass.
$result: inspect(50px);
a {
value: $result;
type: type-of($result);
}
<===> number/unit/output.css
a {
value: 50px;
type: string;
}
<===>
================================================================================
<===> string/unquoted/input.scss
$result: inspect(foo);
a {
value: $result;
type: type-of($result);
}
<===> string/unquoted/output.css
a {
value: foo;
type: string;
}
<===>
================================================================================
<===> string/quoted/input.scss
$result: inspect("foo");
a {
value: $result;
type: type-of($result);
// inspect() should always return an unquoted string, so when it's passed a
// quoted string its return value should contain quote characters. We check
// the length to verify that the quotes are included, since there's no
// built-in way to check whether a string is quoted.
length: str-length($result);
}
<===> string/quoted/output.css
a {
value: "foo";
type: string;
length: 5;
}
<===>
================================================================================
<===> color/literal/README.md
When colors are written literally by the user, rather than being generated by a
function, inspect() should return them in the same format the user wrote them.
<===>
================================================================================
<===> color/literal/short_hex/input.scss
$result: inspect(#00f);
a {
value: $result;
type: type-of($result);
}
<===> color/literal/short_hex/output.css
a {
value: #00f;
type: string;
}
<===>
================================================================================
<===> color/literal/long_hex/input.scss
$result: inspect(#0000ff);
a {
value: $result;
type: type-of($result);
}
<===> color/literal/long_hex/output.css
a {
value: #0000ff;
type: string;
}
<===>
================================================================================
<===> color/literal/named/input.scss
$result: inspect(blue);
a {
value: $result;
type: type-of($result);
}
<===> color/literal/named/output.css
a {
value: blue;
type: string;
}
<===>
================================================================================
<===> color/literal/transparent/input.scss
$result: inspect(transparent);
a {
value: $result;
type: type-of($result);
}
<===> color/literal/transparent/output.css
a {
value: transparent;
type: string;
}
<===>
================================================================================
<===> color/generated/README.md
A color that's generated from a function should be returned as rgba() if its
alpha channel is anything other than 1, or the color name if it has one, or else
the hex code.
<===> color/generated/_utils.scss
/// Returns a copy of `$color` that doesn't have color-literal metadata
/// associated with it.
@function generated-color($color) {
// This doesn't change the value of `$color` at all, but it does construct a
// new object.
@return scale-color($color, $blue: 0%);
}
<===>
================================================================================
<===> color/generated/alpha/input.scss
$result: inspect(rgba(1, 2, 3, 0.4));
a {
value: $result;
type: type-of($result);
}
<===> color/generated/alpha/output.css
a {
value: rgba(1, 2, 3, 0.4);
type: string;
}
<===>
================================================================================
<===> color/generated/transparent/input.scss
@import "../utils";
$result: inspect(generated-color(transparent));
a {
value: $result;
type: type-of($result);
}
<===> color/generated/transparent/output.css
a {
value: rgba(0, 0, 0, 0);
type: string;
}
<===>
================================================================================
<===> color/generated/named/input.scss
@import "../utils";
$result: inspect(generated-color(#00f));
a {
value: $result;
type: type-of($result);
}
<===> color/generated/named/output.css
a {
value: blue;
type: string;
}
<===>
================================================================================
<===> color/generated/short_hex/input.scss
@import "../utils";
$result: inspect(generated-color(#abc));
a {
value: $result;
type: type-of($result);
}
<===> color/generated/short_hex/output.css
a {
value: #aabbcc;
type: string;
}
<===>
================================================================================
<===> color/generated/long_hex/input.scss
@import "../utils";
$result: inspect(generated-color(#abcdef));
a {
value: $result;
type: type-of($result);
}
<===> color/generated/long_hex/output.css
a {
value: #abcdef;
type: string;
}
<===>
================================================================================
<===> boolean/true/input.scss
$result: inspect(true);
a {
value: $result;
type: type-of($result);
}
<===> boolean/true/output.css
a {
value: true;
type: string;
}
<===>
================================================================================
<===> boolean/false/input.scss
$result: inspect(false);
a {
value: $result;
type: type-of($result);
}
<===> boolean/false/output.css
a {
value: false;
type: string;
}
<===>
================================================================================
<===> null/input.scss
$result: inspect(null);
a {
value: $result;
type: type-of($result);
}
<===> null/output.css
a {
value: null;
type: string;
}
<===>
================================================================================
<===> list/empty/input.scss
$result: inspect(());
a {
value: $result;
type: type-of($result);
}
<===> list/empty/output.css
a {
value: ();
type: string;
}
<===>
================================================================================
<===> list/single/space/options.yml
---
:todo:
- sass/libsass#2926
<===> list/single/space/input.scss
$result: inspect(append((), 1, space));
a {
value: $result;
type: type-of($result);
}
<===> list/single/space/output.css
a {
value: 1;
type: string;
}
<===>
================================================================================
<===> list/single/comma/input.scss
$result: inspect((1,));
a {
value: $result;
type: type-of($result);
}
<===> list/single/comma/output.css
a {
value: (1,);
type: string;
}
<===>
================================================================================
<===> list/single/slash/options.yml
---
:todo:
- sass/libsass#2887
<===> list/single/slash/input.scss
$result: inspect(append((), 1, slash));
a {
value: $result;
type: type-of($result);
}
<===> list/single/slash/output.css
a {
value: (1/);
type: string;
}
<===>
================================================================================
<===> list/single/bracketed/undecided/input.scss
$result: inspect([1]);
a {
value: $result;
type: type-of($result);
}
<===> list/single/bracketed/undecided/output.css
a {
value: [1];
type: string;
}
<===>
================================================================================
<===> list/single/bracketed/comma/input.scss
$result: inspect([1,]);
a {
value: $result;
type: type-of($result);
}
<===> list/single/bracketed/comma/output.css
a {
value: [1,];
type: string;
}
<===>
================================================================================
<===> list/space/input.scss
$result: inspect(1 2 3);
a {
value: $result;
type: type-of($result);
}
<===> list/space/output.css
a {
value: 1 2 3;
type: string;
}
<===>
================================================================================
<===> list/comma/input.scss
$result: inspect((1, 2, 3));
a {
value: $result;
type: type-of($result);
}
<===> list/comma/output.css
a {
value: 1, 2, 3;
type: string;
}
<===>
================================================================================
<===> list/bracketed/input.scss
$result: inspect([1, 2, 3]);
a {
value: $result;
type: type-of($result);
}
<===> list/bracketed/output.css
a {
value: [1, 2, 3];
type: string;
}
<===>
================================================================================
<===> list/nested/empty/in_space/bracketed/options.yml
---
:todo:
- sass/libsass#2654
<===> list/nested/empty/in_space/bracketed/input.scss
$result: inspect([() ()]);
a {
value: $result;
type: type-of($result);
}
<===> list/nested/empty/in_space/bracketed/output.css
a {
value: [() ()];
type: string;
}
<===>
================================================================================
<===> list/nested/empty/in_space/unbracketed/input.scss
$result: inspect(() ());
a {
value: $result;
type: type-of($result);
}
<===> list/nested/empty/in_space/unbracketed/output.css
a {
value: () ();
type: string;
}
<===>
================================================================================
<===> list/nested/empty/in_comma/bracketed/input.scss
$result: inspect([(), ()]);
a {
value: $result;
type: type-of($result);
}
<===> list/nested/empty/in_comma/bracketed/output.css
a {
value: [(), ()];
type: string;
}
<===>
================================================================================
<===> list/nested/empty/in_comma/unbracketed/input.scss
$result: inspect(((), ()));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/empty/in_comma/unbracketed/output.css
a {
value: (), ();
type: string;
}
<===>
================================================================================
<===> list/nested/empty/in_slash/options.yml
:todo:
- sass/libsass#2887
<===>
================================================================================
<===> list/nested/empty/in_slash/bracketed/input.scss
$result: inspect(join([(), ()], (), $separator: slash));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/empty/in_slash/bracketed/output.css
a {
value: [() / ()];
type: string;
}
<===>
================================================================================
<===> list/nested/empty/in_slash/unbracketed/input.scss
@use "sass:list";
$result: inspect(list.slash((), ()));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/empty/in_slash/unbracketed/output.css
a {
value: () / ();
type: string;
}
<===>
================================================================================
<===> list/nested/space/in_space/bracketed/options.yml
---
:todo:
- sass/libsass#2654
<===> list/nested/space/in_space/bracketed/input.scss
$result: inspect([(1 2) (3 4)]);
a {
value: $result;
type: type-of($result);
}
<===> list/nested/space/in_space/bracketed/output.css
a {
value: [(1 2) (3 4)];
type: string;
}
<===>
================================================================================
<===> list/nested/space/in_space/unbracketed/input.scss
$result: inspect((1 2) (3 4));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/space/in_space/unbracketed/output.css
a {
value: (1 2) (3 4);
type: string;
}
<===>
================================================================================
<===> list/nested/space/in_comma/bracketed/input.scss
$result: inspect([1 2, 3 4]);
a {
value: $result;
type: type-of($result);
}
<===> list/nested/space/in_comma/bracketed/output.css
a {
value: [1 2, 3 4];
type: string;
}
<===>
================================================================================
<===> list/nested/space/in_comma/unbracketed/input.scss
$result: inspect((1 2, 3 4));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/space/in_comma/unbracketed/output.css
a {
value: 1 2, 3 4;
type: string;
}
<===>
================================================================================
<===> list/nested/space/in_slash/options.yml
:todo:
- sass/libsass#2887
<===>
================================================================================
<===> list/nested/space/in_slash/bracketed/input.scss
$result: inspect(join([1 2, 3 4], (), $separator: slash));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/space/in_slash/bracketed/output.css
a {
value: [1 2 / 3 4];
type: string;
}
<===>
================================================================================
<===> list/nested/space/in_slash/unbracketed/input.scss
@use "sass:list";
$result: inspect(list.slash(1 2, 3 4));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/space/in_slash/unbracketed/output.css
a {
value: 1 2 / 3 4;
type: string;
}
<===>
================================================================================
<===> list/nested/comma/in_space/bracketed/options.yml
---
:todo:
- sass/libsass#2931
<===> list/nested/comma/in_space/bracketed/input.scss
$result: inspect([(1, 2) (3, 4)]);
a {
value: $result;
type: type-of($result);
}
<===> list/nested/comma/in_space/bracketed/output.css
a {
value: [(1, 2) (3, 4)];
type: string;
}
<===>
================================================================================
<===> list/nested/comma/in_space/unbracketed/options.yml
---
:todo:
- sass/libsass#2931
<===> list/nested/comma/in_space/unbracketed/input.scss
$result: inspect((1, 2) (3, 4));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/comma/in_space/unbracketed/output.css
a {
value: (1, 2) (3, 4);
type: string;
}
<===>
================================================================================
<===> list/nested/comma/in_comma/bracketed/input.scss
$result: inspect([(1, 2), (3, 4)]);
a {
value: $result;
type: type-of($result);
}
<===> list/nested/comma/in_comma/bracketed/output.css
a {
value: [(1, 2), (3, 4)];
type: string;
}
<===>
================================================================================
<===> list/nested/comma/in_comma/unbracketed/input.scss
$result: inspect(((1, 2), (3, 4)));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/comma/in_comma/unbracketed/output.css
a {
value: (1, 2), (3, 4);
type: string;
}
<===>
================================================================================
<===> list/nested/comma/in_slash/options.yml
:todo:
- sass/libsass#2887
<===>
================================================================================
<===> list/nested/comma/in_slash/bracketed/input.scss
$result: inspect(join([(1, 2), (3, 4)], (), $separator: slash));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/comma/in_slash/bracketed/output.css
a {
value: [(1, 2) / (3, 4)];
type: string;
}
<===>
================================================================================
<===> list/nested/comma/in_slash/unbracketed/input.scss
@use "sass:list";
$result: inspect(list.slash((1, 2), (3, 4)));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/comma/in_slash/unbracketed/output.css
a {
value: (1, 2) / (3, 4);
type: string;
}
<===>
================================================================================
<===> list/nested/bracketed/in_space/bracketed/input.scss
$result: inspect([[1, 2] [3, 4]]);
a {
value: $result;
type: type-of($result);
}
<===> list/nested/bracketed/in_space/bracketed/output.css
a {
value: [[1, 2] [3, 4]];
type: string;
}
<===>
================================================================================
<===> list/nested/bracketed/in_space/unbracketed/input.scss
$result: inspect([1, 2] [3, 4]);
a {
value: $result;
type: type-of($result);
}
<===> list/nested/bracketed/in_space/unbracketed/output.css
a {
value: [1, 2] [3, 4];
type: string;
}
<===>
================================================================================
<===> list/nested/bracketed/in_comma/bracketed/input.scss
$result: inspect([[1, 2], [3, 4]]);
a {
value: $result;
type: type-of($result);
}
<===> list/nested/bracketed/in_comma/bracketed/output.css
a {
value: [[1, 2], [3, 4]];
type: string;
}
<===>
================================================================================
<===> list/nested/bracketed/in_comma/unbracketed/input.scss
$result: inspect(((1, 2), (3, 4)));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/bracketed/in_comma/unbracketed/output.css
a {
value: (1, 2), (3, 4);
type: string;
}
<===>
================================================================================
<===> list/nested/bracketed/in_slash/options.yml
:todo:
- sass/libsass#2887
<===>
================================================================================
<===> list/nested/bracketed/in_slash/bracketed/input.scss
$result: inspect(join([[1, 2], [3, 4]], (), $separator: slash));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/bracketed/in_slash/bracketed/output.css
a {
value: [[1, 2] / [3, 4]];
type: string;
}
<===>
================================================================================
<===> list/nested/bracketed/in_slash/unbracketed/input.scss
@use "sass:list";
$result: inspect(list.slash([1, 2], [3, 4]));
a {
value: $result;
type: type-of($result);
}
<===> list/nested/bracketed/in_slash/unbracketed/output.css
a {
value: [1, 2] / [3, 4];
type: string;
}
<===>
================================================================================
<===> map/number/input.scss
$result: inspect((1: 2, 3: 4));
a {
value: $result;
type: type-of($result);
}
<===> map/number/output.css
a {
value: (1: 2, 3: 4);
type: string;
}
<===>
================================================================================
<===> map/list/key/space/input.scss
$result: inspect((1 2: 3, 4 5: 6));
a {
value: $result;
type: type-of($result);
}
<===> map/list/key/space/output.css
a {
value: (1 2: 3, 4 5: 6);
type: string;
}
<===>
================================================================================
<===> map/list/key/comma/options.yml
---
:todo:
- sass/libsass#2932
<===> map/list/key/comma/input.scss
$result: inspect(((1, 2): 3, (4, 5): 6));
a {
value: $result;
type: type-of($result);
}
<===> map/list/key/comma/output.css
a {
value: ((1, 2): 3, (4, 5): 6);
type: string;
}
<===>
================================================================================
<===> map/list/value/space/input.scss
$result: inspect((1: 2 3, 4: 5 6));
a {
value: $result;
type: type-of($result);
}
<===> map/list/value/space/output.css
a {
value: (1: 2 3, 4: 5 6);
type: string;
}
<===> map/list/value/space/output-libsass.css
a {
value: (1: (2 3), 4: (5 6));
type: string;
}
<===>
================================================================================
<===> map/list/value/comma/input.scss
$result: inspect((1: (2, 3), 4: (5, 6)));
a {
value: $result;
type: type-of($result);
}
<===> map/list/value/comma/output.css
a {
value: (1: (2, 3), 4: (5, 6));
type: string;
}
<===>
================================================================================
<===> function/input.scss
$result: inspect(get-function("get-function"));
a {
value: $result;
type: type-of($result);
}
<===> function/output.css
a {
value: get-function("get-function");
type: string;
}
<===>
================================================================================
<===> error/too_few_args/input.scss
a {a: inspect()}
<===> error/too_few_args/error
Error: Missing argument $value.
,--> input.scss
1 | a {a: inspect()}
| ^^^^^^^^^ invocation
'
,--> sass:meta
1 | @function inspect($value) {
| =============== declaration
'
input.scss 1:7 root stylesheet
<===> error/too_few_args/error-libsass
Error: Function inspect is missing argument $value.
on line 1 of input.scss
>> a {a: inspect()}
------^
<===>
================================================================================
<===> error/too_many_args/input.scss
a {a: inspect(1, 2)}
<===> error/too_many_args/error
Error: Only 1 argument allowed, but 2 were passed.
,--> input.scss
1 | a {a: inspect(1, 2)}
| ^^^^^^^^^^^^^ invocation
'
,--> sass:meta
1 | @function inspect($value) {
| =============== declaration
'
input.scss 1:7 root stylesheet
<===> error/too_many_args/error-libsass
Error: wrong number of arguments (2 for 1) for `inspect'
on line 1:7 of input.scss
>> a {a: inspect(1, 2)}
------^