You are here

interface CriticalCssProviderInterface in Critical CSS 8

Defines an interface for a Critical CSS Provider.

Classes implementing this interface calculate which CSS file must be used for Critical CSS and return its contents.

Hierarchy

Expanded class hierarchy of CriticalCssProviderInterface

All classes that implement CriticalCssProviderInterface

File

src/Asset/CriticalCssProviderInterface.php, line 11

Namespace

Drupal\critical_css\Asset
View source
interface CriticalCssProviderInterface {

  /**
   * Get critical CSS contents.
   *
   * @return string
   *   The critical CSS contents
   */
  public function getCriticalCss();

  /**
   * Get all possible paths to search, relatives to theme.
   *
   * @return array
   *   Array with all possible paths.
   */
  public function getFilePaths();

  /**
   * Get matched file path.
   *
   * @return string|null
   *   Matched file path, or null if nothing found.
   */
  public function getMatchedFilePath();

  /**
   * Check if module is enabled.
   *
   * @return bool
   *   True if this module is enabled
   */
  public function isEnabled();

  /**
   * Tells whether this request has been already processed.
   *
   * @return bool
   *   True if already processed, false otherwise.
   */
  public function isAlreadyProcessed();

  /**
   * Reset provider so calculations are made again.
   */
  public function reset();

}

Members

Namesort descending Modifiers Type Description Overrides
CriticalCssProviderInterface::getCriticalCss public function Get critical CSS contents. 1
CriticalCssProviderInterface::getFilePaths public function Get all possible paths to search, relatives to theme. 1
CriticalCssProviderInterface::getMatchedFilePath public function Get matched file path. 1
CriticalCssProviderInterface::isAlreadyProcessed public function Tells whether this request has been already processed. 1
CriticalCssProviderInterface::isEnabled public function Check if module is enabled. 1
CriticalCssProviderInterface::reset public function Reset provider so calculations are made again. 1