juice icon indicating copy to clipboard operation
juice copied to clipboard

crash on rule "-webkit-text;"

Open ValerioCietto opened this issue 1 year ago • 0 comments

Minimal example:

<html>
<head>
<style>
		body {
			margin: 0 auto !important;
			padding: 0 !important;
			width: 100% !important;
			height: 100% !important;
			-webkit-text;
			size-adjust: 100%;
			-ms-text-size-adjust: 100%;
		}
	</style>
</head>
<body id="body" bgcolor="f5f5f5" style="margin: 0; padding: 0 !important;">
Test
</body>
</html>

By looking with debugger node_modules/juice/lib/inline.js:259

I can be solved with a try catch like

        try {
        // don't add css variables if we're resolving their values
        if (options.resolveCSSVariables && (prop.prop.indexOf('--') === 0) ) {
          return false;
        }
        
        } catch(error) {
          console.error(error)
        }

because it is a void CSS rule

ValerioCietto avatar Jun 20 '24 09:06 ValerioCietto