@maizzle/framework 5.0.8 → 5.1.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/CHANGELOG.md CHANGED
@@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [5.1.0] - 2025-06-13
8
+
9
+ This release adds support for using Tailwind CSS color opacity modifiers in Gmail by automatically converting modern rgb/a syntax to the legacy, comma-separated syntax.
10
+
11
+ - feat: use commas instead of slash for css color opacity modifiers f26774b
12
+
13
+ ## [5.0.9] - 2025-06-12
14
+
15
+ This release fixes an issue where builds failed because `preferUnitlessValues` (which is on by default) was throwing an error when encountering invalid inline CSS.
16
+
17
+ - fix: skip parsing invalid css in `preferUnitlessValues` e891c14
18
+
19
+ ## [5.0.8] - 2025-04-15
20
+
21
+ This release fixes an issue that prevented the use of `posthtml.plugins.before` and `posthtml.plugins.after` simultaneously.
22
+
23
+ ### Fixed
24
+
25
+ - fix: `posthtml.plugins.before` 4374706
26
+ - build(deps): bump vite from 6.2.5 to 6.2.6 cafa1f6
27
+
7
28
  ## [5.0.7] - 2025-04-03
8
29
 
9
30
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maizzle/framework",
3
- "version": "5.0.8",
3
+ "version": "5.1.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",
@@ -70,6 +70,7 @@
70
70
  "pathe": "^2.0.0",
71
71
  "postcss": "^8.4.49",
72
72
  "postcss-calc": "^10.0.2",
73
+ "postcss-color-functional-notation": "^7.0.10",
73
74
  "postcss-css-variables": "^0.19.0",
74
75
  "postcss-import": "^16.1.0",
75
76
  "postcss-safe-parser": "^7.0.0",
@@ -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 postcssColorFunctionalNotation from 'postcss-color-functional-notation'
20
21
 
21
22
  import defaultComponentsConfig from './defaultComponentsConfig.js'
22
23
 
@@ -36,6 +37,7 @@ export async function process(html = '', config = {}) {
36
37
  tailwindcss(get(config, 'css.tailwind', {})),
37
38
  resolveCSSProps !== false && cssVariables(resolveCSSProps),
38
39
  resolveCalc !== false && postcssCalc(resolveCalc),
40
+ postcssColorFunctionalNotation(),
39
41
  ...get(config, 'postcss.plugins', []),
40
42
  ],
41
43
  merge(
@@ -189,30 +189,31 @@ export async function inline(html = '', options = {}) {
189
189
 
190
190
  // 1. `preferUnitlessValues`
191
191
  if (styleAttr) {
192
- // Parse the inline styles using postcss
193
- const root = postcss.parse(`* { ${styleAttr} }`)
194
-
195
- root.first.each((decl) => {
196
- const property = decl.prop
197
- let value = decl.value
198
-
199
- if (value && options.preferUnitlessValues) {
200
- value = value.replace(
201
- /\b0(px|rem|em|%|vh|vw|vmin|vmax|in|cm|mm|pt|pc|ex|ch)\b/g,
202
- '0'
203
- )
204
- }
205
-
206
- if (property) {
207
- inlineStyles[property] = value
208
- }
209
- })
210
-
211
- // Update the element's style attribute with the new value
212
- $(el).attr(
213
- 'style',
214
- Object.entries(inlineStyles).map(([property, value]) => `${property}: ${value}`).join('; ')
215
- )
192
+ try {
193
+ const root = postcss.parse(`* { ${styleAttr} }`)
194
+
195
+ root.first.each((decl) => {
196
+ const property = decl.prop
197
+ let value = decl.value
198
+
199
+ if (value && options.preferUnitlessValues) {
200
+ value = value.replace(
201
+ /\b0(px|rem|em|%|vh|vw|vmin|vmax|in|cm|mm|pt|pc|ex|ch)\b/g,
202
+ '0'
203
+ )
204
+ }
205
+
206
+ if (property) {
207
+ inlineStyles[property] = value
208
+ }
209
+ })
210
+
211
+ // Update the element's style attribute with the new value
212
+ $(el).attr(
213
+ 'style',
214
+ Object.entries(inlineStyles).map(([property, value]) => `${property}: ${value}`).join('; ')
215
+ )
216
+ } catch {}
216
217
  }
217
218
 
218
219
  // Get the classes from the element's class attribute