Skip to content

Unit math breaks down when numbers have multiple units #2549

@nex3

Description

@nex3

Libsass's unit math fails badly when working with numbers that have multiple numerator and denominator units. As a simple example, (1px * 1rad / 1ms) / 1rad should cancel out the two rad units and produce 1px/ms. However, in Libsass it currently produces 0.02646, without any units.

sass/sass-spec#1205 adds more thorough specs for these cases.

This is pretty high priority: unit arithmetic is already confusing for users, and having Libsass totally bail on moderately complex uses doesn't help.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions