Skip to content

Commit

Permalink
feat(tokens): Format HSL tokens for Style Dictionary compatibility
Browse files Browse the repository at this point in the history
Removed unnecessary 'deg' units from HSL tokens to ensure correct parsing
by Style Dictionary.
  • Loading branch information
thierryc authored and GarthDB committed Apr 19, 2024
1 parent d6edd6e commit 579a446
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions packages/contrast-colors/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,6 @@ function convertColorValue(color, format, object = false) {
if (letter === 'l' || letter === 'j') {
rnd += '%';
}
if (letter === 'h') {
rnd += 'deg';
}
}
} else if (space !== 'hsluv') {
if (letter === 's' || letter === 'l' || letter === 'v') {
Expand All @@ -363,8 +360,6 @@ function convertColorValue(color, format, object = false) {
rnd = round(ch * 100);
rnd += '%';
}
} else if (letter === 'h' && !object) {
rnd += 'deg';
}
}
return rnd;
Expand Down

0 comments on commit 579a446

Please sign in to comment.