@maizzle/framework 4.1.0 → 4.1.1

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": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
5
5
  "license": "MIT",
6
6
  "main": "src/index.js",
@@ -26,8 +26,8 @@ exports.process = async (html, config) => {
26
26
  html = await attributeToStyle(html, config)
27
27
  html = await inline(html, config)
28
28
  html = await shorthandInlineCSS(html, config)
29
- html = await removeInlinedClasses(html, config)
30
29
  html = await removeUnusedCSS(html, config)
30
+ html = await removeInlinedClasses(html, config)
31
31
  html = await removeInlineSizes(html, config)
32
32
  html = await removeInlineBgColor(html, config)
33
33
  html = await removeAttributes(html, config)
@@ -48,7 +48,7 @@ const plugin = () => tree => {
48
48
  * like `margin: 0 0 0 16px` (transformed with mergeLonghand when inlining).
49
49
  */
50
50
  Object.keys(styleAttr).forEach(key => {
51
- if (prop.includes(key)) {
51
+ if (prop && prop.includes(key)) {
52
52
  rule.remove()
53
53
  remove(classAttr, s => selector.includes(s))
54
54
  }
@@ -395,7 +395,6 @@ test('remove inlined selectors', async t => {
395
395
  border: 0;
396
396
  vertical-align: middle
397
397
  }
398
-
399
398
  .hover-text-blue:hover {
400
399
  color: #00a8ff;
401
400
  }
@@ -412,6 +411,15 @@ test('remove inlined selectors', async t => {
412
411
 
413
412
  #keepId {float:none}
414
413
 
414
+ .foo-class {
415
+ /* COMMENT */
416
+ color: red;
417
+ }
418
+
419
+ .ignore {
420
+ display: inline-block;
421
+ }
422
+
415
423
  @media (max-width: 600px) {
416
424
  .ignore {color: blue}
417
425
  }
@@ -421,7 +429,7 @@ test('remove inlined selectors', async t => {
421
429
  </style>
422
430
  </head>
423
431
  <body>
424
- <div id="keepId" class="remove keep ignore" style="color: red; display: inline">
432
+ <div id="keepId" class="remove keep ignore foo-class" style="color: red; display: inline">
425
433
  <h1 class="m-0 mb-4 mt-0 hover-text-blue" style="margin: 0 0 16px;">Title</h1>
426
434
  <img src="https://example.com/image.jpg" style="border: 0; vertical-align: middle">
427
435
  <div id="keepId" class="remove keep ignore" style="color: red; display: inline">text</div>
@@ -441,6 +449,11 @@ test('remove inlined selectors', async t => {
441
449
 
442
450
  #keepId {float:none}
443
451
 
452
+ .foo-class {
453
+ /* COMMENT */
454
+ color: red;
455
+ }
456
+
444
457
  @media (max-width: 600px) {
445
458
  .ignore {color: blue}
446
459
  }
@@ -450,10 +463,10 @@ test('remove inlined selectors', async t => {
450
463
  </style>
451
464
  </head>
452
465
  <body>
453
- <div id="keepId" class="keep ignore" style="color: red; display: inline">
466
+ <div id="keepId" class="keep foo-class" style="color: red; display: inline">
454
467
  <h1 class="hover-text-blue" style="margin: 0 0 16px">Title</h1>
455
468
  <img src="https://example.com/image.jpg" style="border: 0; vertical-align: middle">
456
- <div id="keepId" class="keep ignore" style="color: red; display: inline">text</div>
469
+ <div id="keepId" class="keep" style="color: red; display: inline">text</div>
457
470
  </div>
458
471
  </body>
459
472
  </html>`