@maizzle/framework 5.0.0-beta.32 → 5.0.0-beta.33

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.0.0-beta.32",
3
+ "version": "5.0.0-beta.33",
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",
@@ -68,7 +68,7 @@
68
68
  "ora": "^8.1.0",
69
69
  "pathe": "^1.1.2",
70
70
  "postcss": "^8.4.49",
71
- "postcss-custom-properties": "^14.0.4",
71
+ "postcss-css-variables": "^0.19.0",
72
72
  "postcss-import": "^16.1.0",
73
73
  "postcss-safe-parser": "^7.0.0",
74
74
  "posthtml": "^0.16.6",
@@ -14,17 +14,19 @@ import { getPosthtmlOptions } from './defaultConfig.js'
14
14
  // PostCSS
15
15
  import tailwindcss from 'tailwindcss'
16
16
  import postcssImport from 'postcss-import'
17
+ import cssVariables from 'postcss-css-variables'
17
18
  import postcssSafeParser from 'postcss-safe-parser'
18
- import customProperties from 'postcss-custom-properties'
19
19
 
20
20
  import defaultComponentsConfig from './defaultComponentsConfig.js'
21
21
 
22
22
  export async function process(html = '', config = {}) {
23
+ const resolveCSSProps = get(config, 'css.resolveProps')
24
+
23
25
  const postcssPlugin = posthtmlPostcss(
24
26
  [
25
27
  postcssImport(),
26
28
  tailwindcss(get(config, 'css.tailwind', {})),
27
- get(config, 'css.inline.resolveCSSVariables', true) && customProperties(),
29
+ resolveCSSProps !== false && cssVariables(resolveCSSProps),
28
30
  ...get(config, 'postcss.plugins', []),
29
31
  ],
30
32
  merge(
@@ -61,9 +61,14 @@ async function renderUpdatedFile(file, config) {
61
61
  const startTime = Date.now()
62
62
  spinner.start('Building...')
63
63
 
64
- // beforeCreate event
65
- if (typeof config.beforeCreate === 'function') {
66
- await config.beforeCreate({ config })
64
+ /**
65
+ * Add the current template path to the config
66
+ *
67
+ * Can be used in events like `beforeRender` to determine
68
+ * which template file is being rendered.
69
+ */
70
+ config.build.current = {
71
+ path: path.parse(file),
67
72
  }
68
73
 
69
74
  // Read the file