clearCachedColorValue static method

void clearCachedColorValue(
  1. String color
)

Implementation

static void clearCachedColorValue(String color) {
  final String key = color.toLowerCase();
  // Only log cache clears for var()-driven entries that reference a watched
  // custom property. This keeps noise low while debugging specific
  // CSS variable + transition interactions.
  if (DebugFlags.enableCssVarAndTransitionLogs && key.contains('var(')) {
    if (DebugFlags.watchedCssVariables.isNotEmpty) {
      final String? identifier = _extractVarIdentifierFromCacheKey(key);
      if (identifier != null && DebugFlags.watchedCssVariables.contains(identifier)) {
        cssLogger.info('[color][cache-clear] key=$key var=$identifier');
      }
    }
    // If watchedCssVariables is empty, skip logging entirely to avoid spam
    // from generic Tailwind-style utility variables (blur, brightness, etc.).
  }
  _cachedParsedColor.remove(key);
}