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

An undelimited sequence of digits and letters is treated as a list instead of a single number #1405

Closed
andrew-skybound opened this issue Jul 27, 2015 · 2 comments

Comments

@andrew-skybound
Copy link

A number with a unit identifier that contains number itself should be parsed as a single number. For example, the number 100top1 should have the value 100 and unit top1. Even though there are currently no CSS units which have numbers in them, the CSS grammar defines a unit identifier as an {ident}. In general, it seems that SASS is not strict about this since sequences like 1-2 parse as an arithmetic expression and not the value 1 having the unit -1.

Nevertheless, Ruby SASS treats undelimited digit-letter sequences as a single number. Libsass treats them as lists of separate numbers.

Input:

div {
  foo: length(1a2b3c);
  foo: type-of(1a2b3c);
  foo: unit(1a2b3c);
  foo: (1a2b3c);
}

Ruby SASS:

div {
  foo: 1;
  foo: number;
  foo: "a2b3c";
  foo: 1a2b3c;
}

Libsass:

div {
  foo: 3;
  foo: list;
  /* foo: unit(1a2b3c); causes an error */
  foo: 1a 2b 3c;
}

@xzyfer
Copy link
Contributor

xzyfer commented Jul 28, 2015

@andrew-skybound thanks for the report. I can confirm this issue exists on the latest master.

@mgreter
Copy link
Contributor

mgreter commented Sep 3, 2015

Main use cases are passing now and will be in 3.3!
Last minor issue is tracked in #1526

@mgreter mgreter closed this as completed Sep 3, 2015
@mgreter mgreter modified the milestones: 3.3, 3.3.1 Sep 3, 2015
xzyfer added a commit to xzyfer/sass-spec that referenced this issue Sep 4, 2015
xzyfer added a commit to xzyfer/sass-spec that referenced this issue Sep 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants