Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

3.0.0 CSS Variable hyphen compiling change #403

Closed
@drwpow

Description

@drwpow

Take 2 CSS variables:

:root {
  --space: 32px;
  --space-075: 24px;
}

In both 2.9.x and 3.0.0, the variables compile correctly when used by themselves. However, something interesting happens when you try and invert those values:

2.9.x

margin-left: -var(--space); // -32px
margin-bottom: -var(--space-075); // -24px

3.0.0

margin-left: -var(--space); // -32px
margin-bottom: -var(--space-075); // 24px !!!

I rolled back my version to double-test, and confirmed it’s compiling differently with 3.0.0. Am I missing something? Are hyphens not part of the variable spec? Is it bad practice to prepend/append CSS variables?

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