Sha256: 7cc323cebe0e160c7c4a1d34f28f90817c5f6c6ee29a0f73c5a46fdf53362a7c

Contents?: true

Size: 522 Bytes

Versions: 80

Compression:

Stored size: 522 Bytes

Contents

////
/// @group tools/unit-conversion
////

/// Convert pixels to em
///
/// @param {Number} $value - Length in pixels
/// @param {Number} $context-font-size - Font size of element
/// @return {Number} Length in ems
/// @access public

@function govuk-em($value, $context-font-size) {
  @if unitless($value) {
    $value: $value * 1px;
  }
  @if unitless($context-font-size) {
    $context-font-size: $context-font-size * 1px;
  }
  @return $value / $context-font-size * 1em;
}

/*# sourceMappingURL=_px-to-em.scss.map */

Version data entries

80 entries across 78 versions & 4 rubygems

Version Path
govuk_publishing_components-49.1.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-49.0.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-48.0.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-47.0.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-46.4.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-46.3.1 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-46.3.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-46.2.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-46.1.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-46.0.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.10.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.9.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.8.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.7.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.6.1 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.6.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.5.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.4.1 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.4.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.3.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss