Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit b2f6cf2

Browse files
committed
Adjust unit output
1 parent ab3485d commit b2f6cf2

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/units.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,21 @@ namespace Sass {
334334
if (i) u += '*';
335335
u += numerators[i];
336336
}
337-
if (nL != 0) u += '/';
338-
for (size_t n = 0; n < nL; n += 1) {
339-
if (n) u += '*';
340-
u += denominators[n];
337+
if (iL == 0) {
338+
if (nL > 1) u += '(';
339+
for (size_t n = 0; n < nL; n += 1) {
340+
if (n) u += '*';
341+
u += denominators[n];
342+
}
343+
if (nL > 1) u += ')';
344+
if (nL != 0) u += "^-1";
345+
}
346+
else {
347+
if (nL != 0) u += '/';
348+
for (size_t n = 0; n < nL; n += 1) {
349+
if (n) u += '*';
350+
u += denominators[n];
351+
}
341352
}
342353
return u;
343354
}

0 commit comments

Comments
 (0)