DesignTokenValueInterface.php

Namespace

Drupal\Core\Theme\DesignToken

File

core/lib/Drupal/Core/Theme/DesignToken/DesignTokenValueInterface.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Core\Theme\DesignToken;


/**
 * Interface for design tokens value plugins.
 */
interface DesignTokenValueInterface {
  
  /**
   * Exports as DTCG.
   *
   * @return mixed
   *   DTCG data of the value key.
   */
  public function toDtcg() : mixed;
  
  /**
   * Exports as CSS value.
   *
   * @return string
   *   The CSS variable.
   */
  public function toCss() : string;
  
  /**
   * Prepares configuration for plugin creation.
   *
   * Ensures that the configuration is an associative array.
   *
   * @param mixed $configuration
   *   The configuration to prepare.
   *
   * @return array
   *   The prepared configuration.
   */
  public static function prepareConfiguration(mixed $configuration) : array;

}

Interfaces

Title Deprecated Summary
DesignTokenValueInterface Interface for design tokens value plugins.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.