Sha256: ded41f00a3c3a4b5c4e176b459c84012cc826a6812ae98a265a6763695fa0c4b

Contents?: true

Size: 477 Bytes

Versions: 127

Compression:

Stored size: 477 Bytes

Contents

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

/// Convert pixels to rem
///
/// The $govuk-root-font-size (defined in settings/_typography-responsive.scss)
/// must be configured to match the font-size of your root (html) element
///
/// @param {Number} $value - Length in pixels
/// @return {Number} Length in rems
/// @access public

@function govuk-px-to-rem($value) {
  @if unitless($value) {
    $value: $value * 1px;
  }

  @return $value / $govuk-root-font-size * 1rem;
}

Version data entries

127 entries across 127 versions & 4 rubygems

Version Path
govuk_publishing_components-34.5.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-34.4.2 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-34.4.1 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-34.4.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-34.3.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-34.2.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-34.1.3 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-34.1.2 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_tech_docs-3.3.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-34.1.1 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-34.1.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-34.0.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-33.1.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-33.0.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-32.1.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-32.0.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-31.2.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-31.1.2 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-31.1.1 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss
govuk_publishing_components-31.1.0 node_modules/govuk-frontend/govuk/tools/_px-to-rem.scss