Skip to content

Commit a897e72

Browse files
committed
feat: add postcss-preset-env support for tailwind plugin
1 parent 276b759 commit a897e72

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

internal/builder/embedded/views.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,20 @@ function createTailwindPlugin(viewPath, options = {}) {
427427
}
428428
}
429429

430+
const presetEnvPath = resolveDependency(viewPath, 'postcss-preset-env')
431+
if (presetEnvPath) {
432+
const postcssPresetEnv = require(presetEnvPath)
433+
const isRageMP = options.runtime === 'ragemp'
434+
plugins.push(postcssPresetEnv({
435+
stage: 1,
436+
browsers: isRageMP ? 'chrome 97' : 'chrome 103',
437+
features: {
438+
'color-mix': true,
439+
},
440+
}))
441+
console.log(`[views] postcss-preset-env detected, applying CSS polyfills`)
442+
}
443+
430444
console.log(`[views] Tailwind detected (v${tailwindInfo.version})`)
431445

432446
return {

0 commit comments

Comments
 (0)