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

Complex DR definition works as at-rule #2825

Open
seven-phases-max opened this issue Feb 27, 2016 · 2 comments
Open

Complex DR definition works as at-rule #2825

seven-phases-max opened this issue Feb 27, 2016 · 2 comments

Comments

@seven-phases-max
Copy link
Member

A variable definition with a value that ends with an unnamed ruleset, e.g.

@var: x {y: z};

is interpreted as an unknown at-rule, thus resulting in:

@var : x {
  y: z;
}

This is most likely a result of #2783. (Before #2783, such code resulted in a error, i.e. it's not a regression but more like an overlooked side-effect).
See also related #2270 (comment).

@seven-phases-max
Copy link
Member Author

P.S. Technically, there is an at-rule that has such syntax, i.e.:

@page :first {...}

So the new behavior is not that wrong (not counting that whitespaces in @page are significant and in @var they are not), but if kept, it anticipatorily kills possibilities mentioned at #2270 (comment).

@rjgotten
Copy link
Contributor

Pseudo-class selectors don't allow whitespace though, so you could disambiguate on that:
i.e. @var: x {y: z}; vs @directive :pseudo {y: z};

Following that, the exact example given in your opening comment should not be interpreted as an at-directive, but as a variable.

(Moreover, @page is kind of a special snowflake as well.)

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

2 participants