@maizzle/framework 4.4.0-beta.3 → 4.4.0-beta.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
|
@@ -99,7 +99,9 @@ module.exports = {
|
|
|
99
99
|
const toProcess = [
|
|
100
100
|
postcssNested(),
|
|
101
101
|
tailwindcss(config),
|
|
102
|
-
maizzleConfig
|
|
102
|
+
get(maizzleConfig, 'shorthandCSS', get(maizzleConfig, 'shorthandInlineCSS')) === true ?
|
|
103
|
+
mergeLonghand() :
|
|
104
|
+
() => {},
|
|
103
105
|
...get(maizzleConfig, 'build.postcss.plugins', [])
|
|
104
106
|
]
|
|
105
107
|
|
|
@@ -26,8 +26,8 @@ exports.process = async (html, config) => {
|
|
|
26
26
|
html = await preventWidows(html, config)
|
|
27
27
|
html = await attributeToStyle(html, config)
|
|
28
28
|
html = await inline(html, config)
|
|
29
|
-
html = await shorthandInlineCSS(html, config)
|
|
30
29
|
html = await removeUnusedCSS(html, config)
|
|
30
|
+
html = await shorthandInlineCSS(html, config)
|
|
31
31
|
html = await removeInlineSizes(html, config)
|
|
32
32
|
html = await removeInlineBgColor(html, config)
|
|
33
33
|
html = await removeAttributes(html, config)
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
const posthtml = require('posthtml')
|
|
2
2
|
const {get, merge, isObject, isEmpty} = require('lodash')
|
|
3
|
-
const
|
|
3
|
+
const mergeInlineLonghand = require('posthtml-postcss-merge-longhand')
|
|
4
4
|
const defaultConfig = require('../generators/posthtml/defaultConfig')
|
|
5
5
|
|
|
6
6
|
module.exports = async (html, config, direct = false) => {
|
|
7
|
-
config = direct ?
|
|
7
|
+
config = direct ?
|
|
8
|
+
(isObject(config) ? config : true) :
|
|
9
|
+
get(config, 'shorthandCSS', get(config, 'shorthandInlineCSS', []))
|
|
8
10
|
|
|
9
11
|
const posthtmlOptions = merge(defaultConfig, get(config, 'build.posthtml.options', {}))
|
|
10
12
|
|
|
11
13
|
if (typeof config === 'boolean' && config) {
|
|
12
|
-
html = await posthtml([
|
|
14
|
+
html = await posthtml([mergeInlineLonghand()])
|
|
15
|
+
.process(html, posthtmlOptions)
|
|
16
|
+
.then(result => result.html)
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
if (isObject(config) && !isEmpty(config)) {
|
|
16
|
-
html = await posthtml([
|
|
20
|
+
html = await posthtml([mergeInlineLonghand(config)])
|
|
21
|
+
.process(html, posthtmlOptions)
|
|
22
|
+
.then(result => result.html)
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
return html
|