Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

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

Open
gustavo-roganti opened this issue Apr 25, 2021 · 2 comments

Comments

@gustavo-roganti
Copy link

Linked to #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

@Lofesa
Copy link
Contributor

Lofesa commented Apr 26, 2021

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

@gustavo-roganti
Copy link
Author

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.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants