Function EmToPx->normalise_font_size

Definitions

sources/css_cleanup.php

  • Convert font units. We only want em/rem/px font sizes, so do conversions from the other possible unit types.
  • Visibility: protected
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$font_size string No No required parameter N/A N/A Font size

Returns

  • Normalised font size
  • Type: string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Convert font units. We only want em/rem/px font sizes, so do conversions from the other possible unit types.
 *
 * @param  string $font_size Font size
 * @return string Normalised font size
 */

protected function normalise_font_size(string $font_size) : string