Skip to content

Convert string and ident interpolations to proper Stylus code #79

@kizu

Description

@kizu

Take this Scss example:

.foo {
  content: "he#{'ll'}o";
  position: abs#{'ol'}ute;
}

Right now it converts to a code that throws an error:

.foo
  content: "he{"ll"}o"
  position: abs{"ol"}ute

While we'd need to convert it into something like this:

.foo
  content: "he" + 'll' +"o"
  position: unquote('abs' + "ol" + 'ute')
  1. When the interpolation is inside the string, we need to convert it just into the string concatenation.
  2. When the interpolation is inside an ident, we need to convert it into an unquote with the string concatenation inside.

(there could be other cases with the interpolation I didn't cover there though)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions