Skip to content

Commit 4d2f42d

Browse files
author
James Kolce
committed
[ref: #135] Add pxToRem function
1 parent 7ab0d94 commit 4d2f42d

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎src/core/globals/_functions.scss‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,23 @@ $base-unit: 8 !default;
4949
}
5050

5151

52+
//
53+
// pxToRem
54+
// ------
55+
// Converts a Px value into a Rem value
56+
//
57+
// @access public
58+
//
59+
// @param {Number} $px - value in pixels
60+
//
61+
// @return {Number} Value in Rems
62+
//
63+
64+
@function pxToRem($px) {
65+
@return ($px / $font-base-size) + rem;
66+
}
67+
68+
5269
//
5370
// getColor
5471
// --------

0 commit comments

Comments
 (0)