Skip to content

Less: Spaces between variable name and : are not handled #2925

@KINFOO

Description

@KINFOO

Prettier 1.7.1
Playground link

--parser less

Input:

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

Output:

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

Expected behavior:

Same as when there is not a space before the colon:

Prettier 1.7.1
Playground link

--parser less

Input:

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

Output:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:css/scss/lessIssues affecting CSS, Less or SCSSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions