function Dimension::toCss

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Theme/Plugin/DesignTokenValue/Dimension.php \Drupal\Core\Theme\Plugin\DesignTokenValue\Dimension::toCss()

Exports as CSS value.

Return value

string The CSS variable.

Overrides DesignTokenValueInterface::toCss

File

core/lib/Drupal/Core/Theme/Plugin/DesignTokenValue/Dimension.php, line 67

Class

Dimension
Dimension design token value.

Namespace

Drupal\Core\Theme\Plugin\DesignTokenValue

Code

public function toCss() : string {
  return $this->value . $this->unit->value;
}

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