Skip to content

Spaces between variable name and : are not handled #92

@KINFOO

Description

@KINFOO
  • Node Version: 6.11.3
  • NPM Version: 3.10.10
  • postcss-less Version: 1.1.1

I pin pointed tokenize-at-rule.js#L36.
When declaration contains a space between variable name and :,
It makes state.cssPart one character to shorter to enter word definition bloc.
Test named parses variables with whitespaces between name and ":", merged in #93, reproduces bug.

LESS

.navbar {
  @borderTopPx : 4px;
  .media {
    i.user {
      margin-top: @borderTopPx + 10px;
    }
  }
}

JavaScript

prettier/prettier#2925

Expected Behavior

@borderTopPx to be handled like a variable.

Actual Behavior

@borderTopPx not handled like a variable.

How can we reproduce the behavior?

I noticed this bug using prettier on Less pasted above.
It is described at prettier/prettier#2925, where @lydell can provide more accurate details about parsing expectations.

Test named parses variables with whitespaces between name and ":" reproduces issue.

Thank for the good work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions