function Typography::toCss

File

core/lib/Drupal/Core/Theme/Plugin/DesignTokenValue/Typography.php, line 118

Class

Typography
Typography design token value.

Namespace

Drupal\Core\Theme\Plugin\DesignTokenValue

Code

public function toCss() : string {
  // letterSpacing is not allowed in the font shortcut.
  return implode(' ', [
    $this->fontWeight
      ->toCss(),
    $this->fontSize
      ->toCss() . '/' . $this->lineHeight
      ->toCss(),
    $this->fontFamily
      ->toCss(),
  ]);
}

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