@maizzle/framework 5.0.3 → 5.0.4

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.3",
3
+ "version": "5.0.4",
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",
@@ -142,15 +142,18 @@ export async function inline(html = '', options = {}) {
142
142
 
143
143
  // For each rule in the CSS block we're parsing
144
144
  root.walkRules(rule => {
145
+ // Create a set of selectors
145
146
  const { selector } = rule
146
147
 
147
- selectors.add({
148
- name: selector,
149
- prop: get(rule.nodes[0], 'prop')
150
- })
151
-
148
+ // Add the selector to the set as long as it's not a pseudo selector
149
+ if (!/(^|[^\\])::?[\w-]+/.test(selector)) {
150
+ selectors.add({
151
+ name: selector,
152
+ prop: get(rule.nodes[0], 'prop')
153
+ })
154
+ }
152
155
  // Preserve pseudo selectors
153
- if ([':hover', ':active', ':focus', ':visited', ':link', ':before', ':after'].some(i => selector.includes(i))) {
156
+ else {
154
157
  options.safelist.add(selector)
155
158
  }
156
159