Skip to content

Commit

Permalink
adds px-expect function to override utility suite
Browse files Browse the repository at this point in the history
  • Loading branch information
rmessina1010 committed Feb 2, 2024
1 parent 3b41eba commit 3ecc394
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/formation/sass/override-function.scss
Expand Up @@ -154,4 +154,13 @@ $unit-types: (
$scaled: append($scaled, $scaled-value, $separator);
}
@return $scaled;
}
}

// returns the rem value equivalent to expected px
// for uswds, [optional:true], returns same for formation
@function px-expect($exp, $to-formation : false) {
$denom : if($to-formation, $uswds-base, $formation-base);
$coeff : if($to-formation, $u2f-coeff, $f2u-coeff);
$exp: $exp * 1px;
@return ($exp/$denom) * $coeff + rem;
}

0 comments on commit 3ecc394

Please sign in to comment.