Skip to content

Commit

Permalink
Merge pull request #373 from krypton225/enhance
Browse files Browse the repository at this point in the history
refactor(enhance): ♻️ Rename pixel-to-rem function file to use…
  • Loading branch information
krypton225 committed Dec 22, 2023
2 parents 5c3cf4f + 8ab9188 commit 8934b97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/functions/converters/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
// * forwarding the functionality to convert pixels to rem.
// * please see the `px-to-rem` function for details.
// @see px-to-rem
@forward "px-to-rem";
@forward "pixel-to-rem";

// * percentage to decimal forward.
// * forwarding the functionality to convert percentage to decimal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// * - $base-font-size (variable).
// * - math.unit (SASS function).
// * - cut-unit (function).
// * - approx (function).
// * - toggle (function).

// @param {Number} $px-val
Expand All @@ -46,6 +47,7 @@
@use "sass:math";
@use "../../abstract/variables" as var;
@use "../global/cut-unit" as func;
@use "../../development-utils/approximation-numbers" as Approx;
@use "../../development-utils/toggle-error-message" as Error;

@function px-to-rem($px-val) {
Expand All @@ -62,5 +64,5 @@
@return Error.toggle("The parameter dose not need a unit if it equals to zero.");
}

@return calc(func.cut-unit($px-val) / var.$base-font-size) + rem;
@return Approx.of(calc(func.cut-unit($px-val) / var.$base-font-size)) + rem;
}

0 comments on commit 8934b97

Please sign in to comment.