@maizzle/framework 6.0.0-8 → 6.0.0-9

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,12 @@ 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
+ ## [6.0.0-9] - 2025-07-16
8
+
9
+ ### Changed
10
+
11
+ - refactor: resolving css props acacc14
12
+
7
13
  ## [6.0.0-8] - 2025-07-16
8
14
 
9
15
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maizzle/framework",
3
- "version": "6.0.0-8",
3
+ "version": "6.0.0-9",
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",
@@ -71,8 +71,7 @@
71
71
  "ora": "^8.1.0",
72
72
  "pathe": "^2.0.0",
73
73
  "postcss": "^8.4.49",
74
- "postcss-calc": "^10.0.2",
75
- "postcss-css-variables": "^0.19.0",
74
+ "postcss-custom-properties": "^14.0.6",
76
75
  "postcss-safe-parser": "^7.0.0",
77
76
  "postcss-sort-media-queries": "^5.2.0",
78
77
  "posthtml": "^0.16.6",
@@ -4,7 +4,7 @@ import sortMediaQueries from 'postcss-sort-media-queries'
4
4
  const plugin = (options = {}) => tree => {
5
5
  const process = node => {
6
6
  // Check if this is a style tag with content
7
- if (node.tag === 'style' && node.content && Array.isArray(node.content)) {
7
+ if (node && node.tag === 'style' && node.content && Array.isArray(node.content)) {
8
8
  // Get the CSS content from the style tag
9
9
  const cssContent = node.content.join('')
10
10
 
@@ -1,11 +1,10 @@
1
1
  import postcss from 'postcss'
2
2
  import get from 'lodash-es/get.js'
3
3
  import { defu as merge } from 'defu'
4
- import postcssCalc from 'postcss-calc'
5
4
  import { transform } from 'lightningcss'
6
5
  import tailwindcss from '@tailwindcss/postcss'
7
- import cssVariables from 'postcss-css-variables'
8
6
  import postcssSafeParser from 'postcss-safe-parser'
7
+ import customProperties from 'postcss-custom-properties'
9
8
 
10
9
  const attributes = new Set([
11
10
  'raw',
@@ -31,7 +30,7 @@ export function compileCss(config = {}) {
31
30
  const stylePromises = []
32
31
 
33
32
  tree.walk(node => {
34
- if (node.tag === 'style' && node.content) {
33
+ if (node && node.tag === 'style' && node.content) {
35
34
  if (node.attrs && Object.keys(node.attrs).some(attr => attributes.has(attr))) {
36
35
  return node
37
36
  }
@@ -67,29 +66,26 @@ async function processCss(css, config) {
67
66
  * will apply to all `<style>` tags in the HTML,
68
67
  * unless marked to be excluded.
69
68
  */
70
- const resolveCSSProps = get(config, 'css.resolveProps')
71
- const resolveCalc = get(config, 'css.resolveCalc') !== false
72
- ? get(config, 'css.resolveCalc', { precision: 2 })
73
- : false
74
-
75
- const lightningCssOptions = merge(
76
- get(config, 'css.lightning', {}),
77
- {
78
- targets: {
79
- ie: 1,
80
- },
81
- }
82
- )
69
+ const resolveCSSProps = merge(get(config, 'css.resolveProps', {}), {preseve: false})
70
+
71
+ let lightningCssOptions = get(config, 'css.lightning')
72
+ if (lightningCssOptions !== false) {
73
+ lightningCssOptions = merge(
74
+ lightningCssOptions,
75
+ {
76
+ targets: {
77
+ ie: 1,
78
+ },
79
+ }
80
+ )
81
+ }
83
82
 
84
83
  try {
85
- const processor = postcss([
84
+ const result = await postcss([
86
85
  tailwindcss(get(config, 'css.tailwind', {})),
87
- resolveCSSProps !== false && cssVariables(resolveCSSProps),
88
- resolveCalc !== false && postcssCalc(resolveCalc),
86
+ customProperties(resolveCSSProps),
89
87
  ...get(config, 'postcss.plugins', []),
90
- ].filter(Boolean))
91
-
92
- const result = await processor.process(css, merge(
88
+ ]).process(css, merge(
93
89
  get(config, 'postcss.options', {}),
94
90
  {
95
91
  from: config.cwd || './',
@@ -104,7 +100,7 @@ async function processCss(css, config) {
104
100
  * to be more email-friendly.
105
101
  */
106
102
 
107
- if (result.css?.trim()) {
103
+ if (result.css?.trim() && lightningCssOptions !== false) {
108
104
  try {
109
105
  const { code } = transform(
110
106
  merge(
@@ -10,7 +10,7 @@ import { validAttributeNames } from './postcss/compileCss.js'
10
10
  */
11
11
  const plugin = () => tree => {
12
12
  const process = node => {
13
- if (node.tag === 'style') {
13
+ if (node && node.tag === 'style') {
14
14
  if (node.attrs && Object.keys(node.attrs).some(attr => validAttributeNames.has(attr))) {
15
15
  // Remove the attribute
16
16
  for (const attr of Object.keys(node.attrs)) {