Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
This repository was archived by the owner on Apr 10, 2025. 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

Description

@gustavo-roganti

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

Activity

  1. Lofesa commented on Apr 26, 2021

    @Lofesa
    Contributor

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

  2. gustavo-roganti commented on Apr 26, 2021

    @gustavo-roganti
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions