ci(preview theme): allow gradient colors (2) (#3427)

This commit is contained in:
Alexandr Garbuzov
2023-10-26 21:00:55 +03:00
committed by GitHub
parent 87a3bf38c2
commit 0691084c39
2 changed files with 12 additions and 7 deletions
+4 -1
View File
@@ -245,7 +245,10 @@ const clampValue = (number, min, max) => {
* @returns {boolean} True if the given string is a valid gradient.
*/
const isValidGradient = (colors) => {
return colors.slice(1).every((color) => isValidHexColor(color));
return (
colors.length > 2 &&
colors.slice(1).every((color) => isValidHexColor(color))
);
};
/**