Skip to content

processUrls shouldn't process non-URL expressions in at-rules #311

@nex3

Description

@nex3

Currently, if "processUrls" is set to true, the string map will apply to any parenthesized expression in an at-rule. For example:

/*rtl:options:{
  "stringMap": [
    {
      "name"    : "ltr-rtl",
      "priority": 100,
      "search"  : ["ltr"],
      "replace" : ["rtl"],
      "options" :	{
          "scope" : "url",
          "ignoreCase" : true
        }
    }
  ],
  "processUrls": true
}*/
@foo (rtl);

This is particularly problematic when combined with other PostCSS plugins that add custom at-rules, which may involve the text rtl at various points. As a workaround, I can set "processUrls": {"atrule": false}, but that means that an actual url() expression in an at-rule doesn't get converted.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions