Function EmToPx->convert_em_to_px

Definitions

sources/css_cleanup.php

  • Convert em to px units for a given selector.
  • Visibility: protected
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: float

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$amount_em float No No required parameter N/A N/A Size in em units
$selector string No No required parameter N/A N/A Selector
$is_for_font_size boolean No No False N/A N/A It is for a font size property

Returns

  • Size in px units
  • Type: float
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Convert em to px units for a given selector.
 *
 * @param  float $amount_em Size in em units
 * @param  string $selector Selector
 * @param  boolean $is_for_font_size It is for a font size property
 * @return float Size in px units
 */

protected function convert_em_to_px(float $amount_em, string $selector, bool $is_for_font_size = false) : float