File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -359,7 +359,7 @@ export function parseColorOptions(rawCssCode: string): ColorOption[] {
359359
360360 return declarations
361361 . map ( ( { property : colorName , value : color } : any ) => {
362- const htmlColorRegexp = / ^ # [ 0 - 9 a - f ] { 6 } $ / ;
362+ const htmlColorRegexp = / ^ # [ 0 - 9 a - f ] { 3 , 6 } $ / ;
363363
364364 if ( ! htmlColorRegexp . test ( color ) ) {
365365 return undefined ;
@@ -372,7 +372,7 @@ export function parseColorOptions(rawCssCode: string): ColorOption[] {
372372 ) ?. value ;
373373
374374 assert ( typeof colorDark === "string" ) ;
375- assert ( htmlColorRegexp . test ( colorDark ) ) ;
375+ assert ( htmlColorRegexp . test ( colorDark ) , ` ${ colorDark } doesn't seem to be a color` ) ;
376376
377377 if ( parsedName . brightness . isInvariant ) {
378378 assert ( color === colorDark ) ;
You can’t perform that action at this time.
0 commit comments