@react-email/tailwind 0.0.5 → 0.0.7
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/dist/index.js +6 -4
- package/dist/index.mjs +6 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -80,11 +80,13 @@ var Tailwind = ({ children, config }) => {
|
|
|
80
80
|
if ((_a = domNode.attribs) == null ? void 0 : _a.class) {
|
|
81
81
|
if (hasResponsiveStyles) {
|
|
82
82
|
domNode.attribs.class = domNode.attribs.class.replace(
|
|
83
|
-
/[:#\!\-[\]]+/g,
|
|
83
|
+
/[:#\!\-[\]\/\.%]+/g,
|
|
84
84
|
"_"
|
|
85
85
|
);
|
|
86
86
|
} else {
|
|
87
|
-
domNode.attribs.style
|
|
87
|
+
const currentStyles = domNode.attribs.style ? `${domNode.attribs.style};` : "";
|
|
88
|
+
const tailwindStyles = twi(domNode.attribs.class);
|
|
89
|
+
domNode.attribs.style = `${currentStyles} ${tailwindStyles}`;
|
|
88
90
|
delete domNode.attribs.class;
|
|
89
91
|
}
|
|
90
92
|
}
|
|
@@ -111,8 +113,8 @@ function getMediaQueryCSS(css) {
|
|
|
111
113
|
return `${start}${newcontent}${end}`;
|
|
112
114
|
}
|
|
113
115
|
);
|
|
114
|
-
}).replace(/[.\!\#\w\d\\:\-\[\]]+\s*?{/g, (m) => {
|
|
115
|
-
return m.replace(/[:#\!\-[\\\]]+/g, "_");
|
|
116
|
+
}).replace(/[.\!\#\w\d\\:\-\[\]\/\.%]+\s*?{/g, (m) => {
|
|
117
|
+
return m.replace(/(?<=.)[:#\!\-[\\\]\/\.%]+/g, "_");
|
|
116
118
|
}).replace(/font-family(?<value>[^;\r\n]+)/g, (m, value) => {
|
|
117
119
|
return `font-family${value.replace(/['"]+/g, "")}`;
|
|
118
120
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -48,11 +48,13 @@ var Tailwind = ({ children, config }) => {
|
|
|
48
48
|
if ((_a = domNode.attribs) == null ? void 0 : _a.class) {
|
|
49
49
|
if (hasResponsiveStyles) {
|
|
50
50
|
domNode.attribs.class = domNode.attribs.class.replace(
|
|
51
|
-
/[:#\!\-[\]]+/g,
|
|
51
|
+
/[:#\!\-[\]\/\.%]+/g,
|
|
52
52
|
"_"
|
|
53
53
|
);
|
|
54
54
|
} else {
|
|
55
|
-
domNode.attribs.style
|
|
55
|
+
const currentStyles = domNode.attribs.style ? `${domNode.attribs.style};` : "";
|
|
56
|
+
const tailwindStyles = twi(domNode.attribs.class);
|
|
57
|
+
domNode.attribs.style = `${currentStyles} ${tailwindStyles}`;
|
|
56
58
|
delete domNode.attribs.class;
|
|
57
59
|
}
|
|
58
60
|
}
|
|
@@ -79,8 +81,8 @@ function getMediaQueryCSS(css) {
|
|
|
79
81
|
return `${start}${newcontent}${end}`;
|
|
80
82
|
}
|
|
81
83
|
);
|
|
82
|
-
}).replace(/[.\!\#\w\d\\:\-\[\]]+\s*?{/g, (m) => {
|
|
83
|
-
return m.replace(/[:#\!\-[\\\]]+/g, "_");
|
|
84
|
+
}).replace(/[.\!\#\w\d\\:\-\[\]\/\.%]+\s*?{/g, (m) => {
|
|
85
|
+
return m.replace(/(?<=.)[:#\!\-[\\\]\/\.%]+/g, "_");
|
|
84
86
|
}).replace(/font-family(?<value>[^;\r\n]+)/g, (m, value) => {
|
|
85
87
|
return `font-family${value.replace(/['"]+/g, "")}`;
|
|
86
88
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-email/tailwind",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "A React component to wrap emails with Tailwind CSS",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"html-react-parser": "3.0.9",
|
|
38
38
|
"react": "18.2.0",
|
|
39
39
|
"react-dom": "18.2.0",
|
|
40
|
-
"tw-to-css": "0.0.
|
|
40
|
+
"tw-to-css": "0.0.11"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@testing-library/react": "14.0.0",
|