@@ -12,10 +12,10 @@ import isObject from 'lodash-es/isObject.js'
12
12
import { parser as parse } from 'posthtml-parser'
13
13
import { parseCSSRule } from '../utils/string.js'
14
14
import { useAttributeSizes } from './useAttributeSizes.js'
15
- import defaultPostHTMLConfig from '../posthtml/defaultConfig.js'
15
+ import { getPosthtmlOptions } from '../posthtml/defaultConfig.js'
16
16
17
17
const posthtmlPlugin = ( options = { } ) => tree => {
18
- return inline ( render ( tree ) , options ) . then ( html => parse ( html , defaultPostHTMLConfig ) )
18
+ return inline ( render ( tree ) , options ) . then ( html => parse ( html , getPosthtmlOptions ( ) ) )
19
19
}
20
20
21
21
export default posthtmlPlugin
@@ -150,7 +150,7 @@ export async function inline(html = '', options = {}) {
150
150
rule . walkDecls ( decl => {
151
151
// Resolve calc() values to static values
152
152
if ( options . resolveCalc ) {
153
- decl . value = decl . value . includes ( 'calc(' ) ? calc ( decl . value , { precision : 2 } ) : decl . value
153
+ decl . value = decl . value . includes ( 'calc(' ) ? calc ( decl . value , { precision : 2 } ) : decl . value
154
154
}
155
155
156
156
declarations . add ( decl )
@@ -164,10 +164,10 @@ export async function inline(html = '', options = {}) {
164
164
*/
165
165
if ( options . resolveCSSVariables ) {
166
166
Array . from ( declarations )
167
- /**
168
- * Consider only declarations with a value that includes any of the other declarations' property
169
- * So a decl like color(var(--text-color)) will be removed if there's a decl with a property of --text-color
170
- * */
167
+ /**
168
+ * Consider only declarations with a value that includes any of the other declarations' property
169
+ * So a decl like color(var(--text-color)) will be removed if there's a decl with a property of --text-color
170
+ * */
171
171
. filter ( decl =>
172
172
Array . from ( declarations ) . some ( otherDecl => decl . value . includes ( otherDecl . prop ) )
173
173
|| decl . prop . startsWith ( '--' )
@@ -216,7 +216,7 @@ export async function inline(html = '', options = {}) {
216
216
let { property, value } = parseCSSRule ( i )
217
217
218
218
if ( value && options . resolveCalc ) {
219
- value = value . includes ( 'calc' ) ? calc ( value , { precision : 2 } ) : value
219
+ value = value . includes ( 'calc' ) ? calc ( value , { precision : 2 } ) : value
220
220
}
221
221
222
222
if ( value && options . preferUnitlessValues ) {
0 commit comments