Skip to content

[scss] bug with string inside media expression #3721

Closed

Description

@alexander-akait

Prettier 1.10.2
Playground link

--parser scss

Input:

@if (str-slice($item, 0, 5) == ":self") {
    $k: .15625;
} @else if (str-slice($item, 0, 1) == ": ") {
    $k: .08803;
} @else {
    $k: .065106;
}

Output:

@if (str-slice($item, 0, 5) == ": self") {
    $k: .15625;
} @else if (str-slice($item, 0, 1) == ":  ") {
    $k: .08803;
} @else {
    $k: .065106;
}

Expected behavior:

@if (str-slice($item, 0, 5) == ":self") {
    $k: .15625;
} @else if (str-slice($item, 0, 1) == ": ") {
    $k: .08803;
} @else {
    $k: .065106;
}

Activity

  1. lydell commented on Jan 11, 2018

    @lydell
    Member

    Could you add a line or two explaining what the issue is? I have a hard time finding the difference between input, output and expected :)

  2. j-f1 commented on Jan 11, 2018

    @j-f1
    Member

    Diff:

    - @if (str-slice($item, 0, 5) == ": self") {
    + @if (str-slice($item, 0, 5) == ":self") {
  3. alexander-akait commented on Jan 11, 2018

    @alexander-akait
    MemberAuthor

    @lydell ":self" > ": self"

  4. added
    locked-due-to-inactivity
    on Jul 6, 2018
  5. locked as resolved and limited conversation to collaborators on Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions