Sass'sstring type.

⚠️ Heads up!

ThisAPI currently provides no way of distinguishing betweenaquoted andunquoted string.

Hierarchy

  • String

Constructors

Methods

Constructors

constructor

Methods

getValue

  • getValue():string
  • Returns the contents of the string. If the string contains escapes,those escapes are included literally if it’sunquoted,while the values of the escapes are included if it’squoted.

    Example

    // string is `Arial`.
    string.getValue();// "Arial"

    // string is `"Helvetica Neue"`.
    string.getValue();// "Helvetica Neue"

    // string is `\1F46D`.
    string.getValue();// "\\1F46D"

    // string is `"\1F46D"`.
    string.getValue();// "👭"

    Returnsstring

setValue

  • setValue(value:string):void
  • Destructively modifies this string by setting its numeric value tovalue.

    ⚠️ Heads up!

    Even if the string was originally quoted, this will causeit to become unquoted.

    Deprecated

    Useconstructor instead.

    Parameters

    • value:string

    Returnsvoid