interface DesignTokenInterface

Interface for design token config entity.

@internal This API is experimental.

Hierarchy

Expanded class hierarchy of DesignTokenInterface

All classes that implement DesignTokenInterface

2 files declare their use of DesignTokenInterface
CssSelectorConstraintValidator.php in core/lib/Drupal/Core/Theme/Plugin/Validation/Constraint/CssSelectorConstraintValidator.php
DesignTokenConfigEntityKernelTest.php in core/tests/Drupal/KernelTests/Core/Theme/DesignToken/DesignTokenConfigEntityKernelTest.php

File

core/lib/Drupal/Core/Theme/Entity/DesignTokenInterface.php, line 16

Namespace

Drupal\Core\Theme\Entity
View source
interface DesignTokenInterface extends ConfigEntityInterface {
  
  /**
   * The character used has placeholder for the dot character.
   *
   * Keyed lists in config cannot accept dot. So this character is used when
   * saving are reading the scopes in config.
   */
  public const DOT_CONVERSION_CHARACTER = '%';
  
  /**
   * Gets CSS variable name.
   *
   * @return string
   *   The CSS variable name.
   */
  public function getCssVariableName() : string;
  
  /**
   * Gets scopes with design token plugin values according to the type.
   *
   * @return \Drupal\Core\Theme\DesignToken\DesignTokenValuePluginCollection
   *   The prepared scope collection.
   */
  public function getScopes() : DesignTokenValuePluginCollection;
  
  /**
   * Exports the given tokens into CSS variables.
   *
   * @param \Drupal\Core\Theme\Entity\DesignTokenInterface[] $tokens
   *   The token entities.
   *
   * @return string
   *   The inline CSS.
   */
  public static function toCss(array $tokens) : string;

}

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