Skip to content

Correctly purge decimal spacing classes #35

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

Merged
merged 1 commit into from
Feb 6, 2021

Conversation

kristiankozak
Copy link

Previously, decimal spacing classes such as p-0.5 were incorrectly purged out. This PR fixes this by improving the class detection regex.

More details on the issue:

  • The problem were utility classes that include a period, such as px-0.5 or gap-2.5
  • Such classes were correctly extracted from ERB, but incorrectly parsed out from the tailwind CSS file
  • Because of the leading backslash required in CSS, e.g. the .px-1\.5 class was extracted as px-1 and it's fate was then decided by the purger as such :-)

Not sure if there was any particular reason for handling the period in the previous form of the regex, but this simple change has been working well for me so far.

Thanks for building such an awesome library, removing Webpack was a pleasure!

@dhh dhh merged commit a3ce818 into rails:main Feb 6, 2021
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

Successfully merging this pull request may close these issues.

2 participants