We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9f4b796 + 02ea993 commit f859affCopy full SHA for f859aff
knapsack/_utilities.scss
@@ -2,7 +2,29 @@
2
// Utilities
3
// ----
4
5
-//- Function: Rem Calculator
+
6
7
+/// Power function
8
+/// @param {Number} $x
9
+/// @param {Number} $n
10
+/// @return {Number}
11
+/// @group utilities
12
+/// @source https://github.com/adambom/Sass-Math/blob/master/math.scss Sass-Math
13
+@function pow($x, $n) {
14
+ $result: 1;
15
16
+ @if $n >= 0 {
17
+ @for $i from 1 through $n {
18
+ $result: $result * $x;
19
+ }
20
+ } @else {
21
+ @for $i from $n to 0 {
22
+ $result: $result / $x;
23
24
25
+ @return $result;
26
+}
27
28
///
29
/// Calculates and returns the rem value based on px input. Default base font
30
/// size is 16px, but can be changed with a global `$base-font-size` variable.
0 commit comments