@maizzle/framework 5.4.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maizzle/framework",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -74,6 +74,7 @@
74
74
  "postcss-css-variables": "^0.19.0",
75
75
  "postcss-import": "^16.1.0",
76
76
  "postcss-safe-parser": "^7.0.0",
77
+ "postcss-sort-media-queries": "^5.2.0",
77
78
  "posthtml": "^0.16.6",
78
79
  "posthtml-attrs-parser": "^1.1.1",
79
80
  "posthtml-base-url": "^3.1.8",
@@ -17,6 +17,7 @@ import postcssCalc from 'postcss-calc'
17
17
  import postcssImport from 'postcss-import'
18
18
  import cssVariables from 'postcss-css-variables'
19
19
  import postcssSafeParser from 'postcss-safe-parser'
20
+ import postcssSortMediaQueries from 'postcss-sort-media-queries'
20
21
  import postcssColorFunctionalNotation from 'postcss-color-functional-notation'
21
22
 
22
23
  import defaultComponentsConfig from './defaultComponentsConfig.js'
@@ -26,18 +27,20 @@ export async function process(html = '', config = {}) {
26
27
  * Configure PostCSS pipeline. Plugins defined and added here
27
28
  * will apply to all `<style>` tags in the HTML.
28
29
  */
29
- const resolveCSSProps = get(config, 'css.resolveProps')
30
+ const resolveCSSProps = get(config, 'css.resolveProps', true)
31
+ const mediaConfig = get(config, 'css.media')
30
32
  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
32
34
  : false
33
35
 
34
36
  const postcssPlugin = posthtmlPostcss(
35
37
  [
36
38
  postcssImport(),
37
39
  tailwindcss(get(config, 'css.tailwind', {})),
38
- resolveCSSProps !== false && cssVariables(resolveCSSProps),
40
+ resolveCSSProps && cssVariables(resolveCSSProps),
39
41
  resolveCalc !== false && postcssCalc(resolveCalc),
40
42
  postcssColorFunctionalNotation(),
43
+ mediaConfig && postcssSortMediaQueries(mediaConfig === true ? {} : mediaConfig),
41
44
  ...get(config, 'postcss.plugins', []),
42
45
  ],
43
46
  merge(