PostCSS Preset Env
postcss-preset-env lets you use modern CSS features today by converting them to browser-compatible CSS based on your target browsers. It is built on PostCSS and uses data from caniuse.com and MDN.
Usage
Preset Env is a CSS processor that can be enabled from the style editor menu, or configured via the processors property of the configuration object.
When enabled, modern CSS features (like @custom-media, @nest, color functions, etc.) are transpiled to browser-compatible CSS.
Preset Env can be used alongside other processors. Multiple processors are applied in the order they appear in the style editor menu.
Autoprefixer is disabled by default when using Preset Env (since Preset Env handles prefixing). Enable Autoprefixer separately if needed.
Demo
Processor Info
Name
postcssPresetEnv
Editor
style
Processor
Version
postcss-preset-env: v10.4.0
Custom Settings
Custom settings added to the property postcssPresetEnv are passed as options to postcss-preset-env. Please check the documentation for full reference.
Please note that custom settings should be valid JSON (i.e. functions are not allowed).
Example:
{
"postcssPresetEnv": {
"stage": 2,
"features": {
"nesting-rules": true
}
}
}
Links
- postcss-preset-env
- PostCSS in LiveCodes
- CSS Processors in LiveCodes