Skip to content

type-of() returns wrong type for map keys #296

@nd-

Description

@nd-

The type of keys in maps is always string, even for numbers with units.

Example:

$map: (
    600px: 20px
);
@each $key, $value in $map {
    @error 'value #{$key} type #{type-of($key)} -- value #{$value} type #{type-of($value)}';
}

Compiled with scssphp:

value 600px type string -- value 20px type number

Compiled with compass:

value 600px type number -- value 20px type number

The spec says:

Numbers, which may or may not have units, like 12 or 100px.

https://sass-lang.com/documentation/values

Metadata

Metadata

Assignees

No one assigned

    Labels

    spec complianceIssues with compliance to the Sass spec

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions