(varName: string, value: string)
| 455 | } |
| 456 | |
| 457 | private inspectVariable(varName: string, value: string) { |
| 458 | this.unstableVarValues.set(varName, value); |
| 459 | |
| 460 | if (isVarDependant(value) && isConstructedColorVar(value)) { |
| 461 | this.unknownColorVars.add(varName); |
| 462 | this.definedVars.add(varName); |
| 463 | } |
| 464 | if (this.definedVars.has(varName)) { |
| 465 | return; |
| 466 | } |
| 467 | this.definedVars.add(varName); |
| 468 | |
| 469 | // Check if the value is either a raw value or a value that can be parsed |
| 470 | // e.g. rgb, hsl. |
| 471 | const isColor = Boolean( |
| 472 | getRGBValues(value) || |
| 473 | parseColorWithCache(value) |
| 474 | ); |
| 475 | if (isColor) { |
| 476 | this.unknownColorVars.add(varName); |
| 477 | } else if ( |
| 478 | value.includes('url(') || |
| 479 | value.includes('linear-gradient(') || |
| 480 | value.includes('radial-gradient(') |
| 481 | ) { |
| 482 | this.resolveVariableType(varName, VAR_TYPE_BG_IMG); |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | private resolveVariableType(varName: string, typeNum: number) { |
| 487 | const initialType = this.initialVarTypes.get(varName) || 0; |
no test coverage detected