@@ -17,6 +17,7 @@ import postcssCalc from 'postcss-calc'
1717import postcssImport from 'postcss-import'
1818import cssVariables from 'postcss-css-variables'
1919import postcssSafeParser from 'postcss-safe-parser'
20+ import postcssSortMediaQueries from 'postcss-sort-media-queries'
2021import postcssColorFunctionalNotation from 'postcss-color-functional-notation'
2122
2223import defaultComponentsConfig from './defaultComponentsConfig.js'
@@ -26,18 +27,20 @@ export async function process(html = '', config = {}) {
2627 * Configure PostCSS pipeline. Plugins defined and added here
2728 * will apply to all `<style>` tags in the HTML.
2829 */
29- const resolveCSSProps = get ( config , 'css.resolveProps' )
30+ const resolveCSSProps = get ( config , 'css.resolveProps' , true )
31+ const mediaConfig = get ( config , 'css.media' )
3032 const resolveCalc = get ( config , 'css.resolveCalc' ) !== false
31- ? get ( config , 'css.resolveCalc' , { precision : 2 } ) // it's true by default, use default precision 2
33+ ? get ( config , 'css.resolveCalc' , { precision : 2 } ) // enabled by default, use default precision 2
3234 : false
3335
3436 const postcssPlugin = posthtmlPostcss (
3537 [
3638 postcssImport ( ) ,
3739 tailwindcss ( get ( config , 'css.tailwind' , { } ) ) ,
38- resolveCSSProps !== false && cssVariables ( resolveCSSProps ) ,
40+ resolveCSSProps && cssVariables ( resolveCSSProps ) ,
3941 resolveCalc !== false && postcssCalc ( resolveCalc ) ,
4042 postcssColorFunctionalNotation ( ) ,
43+ mediaConfig && postcssSortMediaQueries ( mediaConfig === true ? { } : mediaConfig ) ,
4144 ...get ( config , 'postcss.plugins' , [ ] ) ,
4245 ] ,
4346 merge (
0 commit comments