code: protected function locateAppResource($name, $dir = null, $first = true)
      {
          /** @var AbstractKernel $kernel */
          $kernel = $this->kernel;
          if ($this->kernel instanceof AbstractKernel) {
              $themeName = $this->activeTheme->getName();
              if (isset($kernel->getThemes()[$themeName])) {
                  $theme           = $kernel->getThemes()[$themeName];
                  $this->lastTheme = $theme->getShortName();
              }
          }
  
          return parent::locateAppResource($name, $dir, $first);
      }
docs: Locate Resource Theme aware. Only working for app/Resources.
  
  @param string $name
  @param string $dir
  @param bool   $first
  
  @return string|array