Skip to content

Commit

Permalink
Merge pull request #258 from jaredh159/negative-z-index
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredh159 authored Dec 11, 2023
2 parents 1113e07 + d974cde commit f765c9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ClassParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export default class ClassParser {
if (this.consumePeeked(`z-`)) {
const zIndex = Number(theme?.zIndex?.[this.rest] ?? this.rest);
if (!Number.isNaN(zIndex)) {
return complete({ zIndex });
return complete({ zIndex: this.isNegative ? -zIndex : zIndex });
}
}

Expand Down
1 change: 1 addition & 0 deletions src/__tests__/z-index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ describe(`z-index utilities`, () => {
[`z-0`, { zIndex: 0 }],
[`z-10`, { zIndex: 10 }],
[`z-30`, { zIndex: 30 }],
[`-z-30`, { zIndex: -30 }],
[`z-100`, { zIndex: 100 }],
// arbitrary
[`z-194`, { zIndex: 194 }],
Expand Down

0 comments on commit f765c9f

Please sign in to comment.