Skip to content

Commit

Permalink
@var: percent = percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
PRO-2684 committed Jul 23, 2024
1 parent d6ce956 commit 84e18cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function applyVariables(css, variables) {
const float = parseFloat(value);
return isNaN(float) ? match : float.toString();
}
case "percent":
case "percentage": {
const int = parseInt(value);
return isNaN(int) ? match : `${int}%`;
Expand Down Expand Up @@ -205,6 +206,7 @@ async function onSettingWindowCreated(view) {
}
break;
}
case "percent":
case "percentage": {
varInput.type = "number";
const [defaultValue, min, max, step] = varObj["default-value"].split(",").map(parseFloat);
Expand Down

0 comments on commit 84e18cf

Please sign in to comment.