Skip to content

Commit

Permalink
CSS variable name fix (#38)
Browse files Browse the repository at this point in the history
* hash fix

* add changeset
  • Loading branch information
nsaunders committed May 30, 2024
1 parent e6a3fba commit 9a4ca33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/gorgeous-mails-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@embellish/core": patch
"@embellish/react": patch
---

Fix for CSS variable names sometimes being invalid.
4 changes: 3 additions & 1 deletion packages/core/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ export function createHash(obj: unknown) {
hashValue &= 0x7fffffff;
}

return hashValue.toString(36);
const str = hashValue.toString(36);

return /^[0-9]/.test(str) ? `a${str}` : str;
}

0 comments on commit 9a4ca33

Please sign in to comment.