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

Re-architect CSS transform + Support SCSS Modules + Support basic TailwindCSS #133

Merged
merged 5 commits into from
Jun 17, 2022

Conversation

nvh95
Copy link
Owner

@nvh95 nvh95 commented Jun 3, 2022

Features

  • Re-architect CSS transform. (pre-processor CSS => post-processor CSS)
  • Support SCSS Modules (.module.scss)
  • Support basic TailwindCSS 🧪 Support Tailwindcss #127

@netlify
Copy link

netlify bot commented Jun 3, 2022

Deploy Preview for jest-preview-library canceled.

Name Link
🔨 Latest commit b0235ff
🔍 Latest deploy log https://app.netlify.com/sites/jest-preview-library/deploys/62a77241f9f95900080da0f7

@nvh95 nvh95 self-assigned this Jun 3, 2022
@nvh95 nvh95 marked this pull request as draft June 4, 2022 03:38
@nvh95 nvh95 mentioned this pull request Jun 13, 2022
1 task
@nvh95 nvh95 force-pushed the rearchitect-css-transform branch from 0faf137 to 6a59e6f Compare June 13, 2022 10:44
@nvh95 nvh95 force-pushed the rearchitect-css-transform branch from 6a59e6f to 0ec5315 Compare June 13, 2022 13:32
sundaycrafts and others added 3 commits June 13, 2022 23:03
@nvh95 nvh95 linked an issue Jun 14, 2022 that may be closed by this pull request
Comment on lines +104 to +111
if (isModule) {
return processCSSModules(cssSrc, filename);
}

// TailwindCSS
if (isTailwindCSS(cssSrc)) {
return processTailwindCSS(cssSrc, filename);
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to dynamically update the config, then feed it into a single postss execution?

@nvh95 nvh95 marked this pull request as ready for review June 17, 2022 09:27
@nvh95 nvh95 merged commit 9b6e626 into main Jun 17, 2022
@nvh95 nvh95 deleted the rearchitect-css-transform branch June 17, 2022 09:28
@nvh95 nvh95 added the future work needed Merged PR or Closed Issue but need to visit in the future label Jun 17, 2022
@nvh95
Copy link
Owner Author

nvh95 commented Jun 17, 2022

To work on this case
https://github.com/nvh95/jest-preview/pull/127/files#r884083236

This part result.css.replace(/\\\\/g, '') is hard to read even more regex is already complex.
It is parsed as result.css.replace(/\\/g, '')) on runtime.

Tailwindcss has CSS classes like .hover:text-red-500 {}. It will be compiled as .hover\:text-red-500 {}. But JSDom can't parse it so we have to remove that escaping character.

@nvh95 nvh95 linked an issue Jun 29, 2022 that may be closed by this pull request
@nvh95 nvh95 changed the title Re-architect CSS transform Re-architect CSS transform + Support SCSS Modules + Support basic TailwindCSS Jul 19, 2022
@nvh95 nvh95 mentioned this pull request Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future work needed Merged PR or Closed Issue but need to visit in the future
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Tailwind CSS Support Sass CSS Modules (.module.scss)
2 participants