Skip to content

SCSS: String contents can be changed in nested interpolations #2734

@lydell

Description

@lydell
a {
  k: "#{".5"}";
}

is turned into:

a {
  k: "#{"0.5"}";
}

Playground

Expected: The inner string, ".5", should stay unchanged.

This happens because postcss-values-parser does not support interpolations in strings, so it sees the property value as the string "#{" followed by the number .5 followed by the string "}". shellscape/postcss-values-parser#37

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:css/scss/lessIssues affecting CSS, Less or SCSSscope: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