incubator-pagespeed-mod icon indicating copy to clipboard operation
incubator-pagespeed-mod copied to clipboard

CSS Minification - custom properties with value 0 followed by a unit is rewritten to 0 without a unit.

Open gustavo-roganti opened this issue 4 years ago • 2 comments

Linked to https://github.com/apache/incubator-pagespeed-mod/issues/1538

A css custom property (see https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) is defined as --custom-offset: 0px and is then used in a CSS rule top: calc(50% + var(--custom-offset))

but mod_pagespeed (version 1.13.35.2-0) rewrites the variable removing the px as --custom-offset:0

and the calc() rule breaks.

The fix to bug 1538 checks if the css value is used in "calc(" but this does not work if the value is stored in a custom variable

gustavo-roganti avatar Apr 25 '21 15:04 gustavo-roganti

Have you tried the latest version 1.14.36.1 or latest-beta?

Lofesa avatar Apr 26 '21 10:04 Lofesa

I'm sorry but I am not able to try in a newer version. I'm using a pre-made docker image (bitnami wordpress) with version 1.13.35.2-0 in it. I know too little to set up a testing environment with the latest version.

If anyone else could check if --custom-offset: 0px gets converted to --custom-offset: 0 on the latest versions, it would point to this bug still being present.

gustavo-roganti avatar Apr 26 '21 13:04 gustavo-roganti