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

Escaped Class Names Using Vars Incorrectly Set to undefined #137

Open
shellscape opened this issue Nov 29, 2023 · 2 comments
Open

Escaped Class Names Using Vars Incorrectly Set to undefined #137

shellscape opened this issue Nov 29, 2023 · 2 comments

Comments

@shellscape
Copy link

Consider the following CSS:

.bg-\\[url\\(https\\:\\/\\/example\\.com\\/image\\.png\\)\\] {
  --un-url: url(https://example.com/image.png); background-image:var(--un-url);
}

The output from running the plugin is:

.bg-\\[url\\(https\\:\\/\\/example\\.com\\/image\\.png\\)\\] {
  background-image:undefined;
}
.bg-\\[url\\(https\\:\\/\\/example\\.com\\/image\\.png\\)\\]:\\/\\/example\\.com\\/image\\.png\\)\\]{
  background-image:url(https://example.com/image.png);
}

The plugin seems to have an issue with escaping, or a variable directly following escaping.

@shellscape
Copy link
Author

@shellscape
Copy link
Author

Here's an additional reproduction set:

Input: .xl\\:bg-green-500{--un-bg-opacity:1;background-color:rgb(34 197 94 / var(--un-bg-opacity));}

Expected: .xl\\:bg-green-500{background-color:rgb(34 197 94 / 1);}

Actual: .xl\\:bg-green-500{background-color:undefined}.xl\\:bg-green-500:bg-green-500{background-color:rgb(34 197 94/1)}

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

No branches or pull requests

1 participant