Skip to content

Commit

Permalink
fix: improve radius regex
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRivers committed Jan 15, 2025
1 parent 424c864 commit 639a5c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ const isValidColor = (color: string | undefined) =>
!color ||
/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^rgb\(.*\)$|^rgba\(.*\)$/.test(color);
const isValidBorderRadius = (radius: string | undefined) =>
!radius || /^\d+(%|px|rem|em)$/.test(radius);
!radius || /^(0|\d+(.(\d)+)?(%|px|rem|em))$/.test(radius);

const coloursValid = (...colors: (string | undefined)[]) =>
colors.every(isValidColor) || undefined;
Expand Down

0 comments on commit 639a5c9

Please sign in to comment.