Skip to content

Commit

Permalink
Fix #18 (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexaka1 authored May 2, 2024
1 parent ce532ce commit e3fa59c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/serious-laws-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alexaka1/tailwindcss-oklch": patch
---

Fix case when for hue gray colors, that also have a chroma of 0.
3 changes: 3 additions & 0 deletions src/tailwindcss-oklch/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export default plugin.withOptions<TailwindOklchOptions>(
if (value === undefined || typeof value === 'string') {
return value;
}
if (Number.isNaN(value)) {
return (0).toString();
}
return value.toFixed(precision).replace(/\.?0+$/, '');
};

Expand Down

0 comments on commit e3fa59c

Please sign in to comment.