Skip to content

Commit

Permalink
feat(functions): add unitless function
Browse files Browse the repository at this point in the history
  • Loading branch information
didimmova committed Apr 5, 2024
1 parent 28c88c7 commit 1930205
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sass/utils/_math.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@

@return $sign + $result;
}

/// Removes measurement units from variable.
/// @access private
/// @param {Number} $var - The variable to remove the unit of.
/// @return {Number} - The given variable without units.
@function unitless($var) {
@return math.div($var, $var * 0 + 1);
}

0 comments on commit 1930205

Please sign in to comment.