FFFF CSS variable `--0` being altered to `-0` · Issue #861 · tdewolff/minify · GitHub
[go: up one dir, main page]

Skip to content

CSS variable --0 being altered to -0 #861

Closed

Description

@gauntface

First off - thank you for this tool, I've been using it for a long time on a few personal sites and it's worked really well.

I'm not 100% sure, but I think minify is breaking a CSS variable.

I have a block off css like this:

body{background:var(--5);color:var(--2);font-family:var(--4);font-size:calc(var(--0)*1.5)}

This is some CSS that has gone through postcss and is using postcss-variable-compress to reduce the size of CSS variable names.

This CSS is injected into the HTML of a page and after running minify on the resulting HTML, the CSS is altered to:

body{background:var(--5);color:var(--2);font-family:var(--4);font-size:calc(var(-0)*1.5)}

Note: var(--0) is changed to var(-0)

Maybe there is a rule similar to "take -0 and reduce it to 0" that is kicking in here when it shouldn't

Activity

  1. tdewolff commented on Oct 16, 2025

    @tdewolff
    Owner

    Thanks, this should now be fixed.

  2. added a commit that references this issue on Oct 16, 2025
    5f95acf
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0