Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Escape commas in class names to workaround minifier bug #91

Merged
merged 1 commit into from
Mar 17, 2021

Conversation

bradlc
Copy link
Contributor

@bradlc bradlc commented Mar 17, 2021

Fixes #45

There seems to be a bug in cssnano (seen in the playground here) which splits selectors by commas, even when they are escaped, for example:

/* Input */
.grid-cols-\[1fr\,128px\] {
  grid-template-columns: 1fr 128px;
}

/* Output */
128px\],.grid-cols-\[1fr\{grid-template-columns:1fr 128px}

This PR works around this by adding two new util functions which extend the ones found in tailwindcss. These functions replace commas with \2c to avoid the issue.

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

Successfully merging this pull request may close these issues.

Arbitrary values with commas don't work in production builds in Next.js
2 participants