You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// src/transform.tsexportfunctionprocessCss(src: string,filename: string){// Pre-process file with Sass/ Less/ Stylus
...
// Check if project use PostCSSconst{ plugins, options }=postcssrc.sync(ctx)const{ css }=postcss(plugins).process(src,options)injectToHead(css)// Else, likely raw CSS, just inject to head directlyinjectToHead(src)}
Describe alternatives you've considered
None
Additional context
Will provide if there any in the future
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Now,
jest-preview
is currently supporting TailwindCSS (#100). It does usepostcss
but only for tailwindcssjest-preview/src/transform.ts
Lines 251 to 261 in b0b598d
By supporting PostCSS natively, it can solve a number of issues
jest-preview
Describe the solution you'd like
Current logic
tailwindcss
plugins).Desured logic
Describe how should jest-preview implements this feature
postcss-load-config
does not run in browser context: 🧪 Support Tailwindcss #127 (comment)postcss-load-config
default run in async mode. However, it has to run in SYNC mode (in Jest Code Transformation), we have 2 options:.sync
:postcssrc.sync
(Example of how to return styles as variable/value rather than write to file? postcss/postcss-load-config#194 (comment))The pseudocode will look like this:
Describe alternatives you've considered
None
Additional context
Will provide if there any in the future
The text was updated successfully, but these errors were encountered: