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_tech_docs-4.1.1 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.2.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.1.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-45.0.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
katalyst-govuk-formbuilder-1.13.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.11.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.10.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.9.1 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.9.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.8.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.7.1 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.7.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_tech_docs-4.1.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.6.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_tech_docs-4.0.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.5.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.4.2 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.4.1 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.4.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
govuk_publishing_components-44.3.0 node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss