Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nex3 opened this issue Nov 16, 2022 · 0 comments
Open

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

nex3 opened this issue Nov 16, 2022 · 0 comments

Comments

@nex3
Copy link

nex3 commented Nov 16, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants