Skip to content

Commit

Permalink
Add a strip-units function to make sure every value is accepted (15…
Browse files Browse the repository at this point in the history
… or 15px)
  • Loading branch information
louismaximepiton committed Oct 2, 2024
1 parent f5a2c44 commit 0e03ca3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scss/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,12 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
}

// OUDS mod
@function strip-units($value) {
@return divide($value, $value * 0 + 1)
}

@function px-to-rem($value) {
$rem-value: $value * .0625; // Assumes the browser default, typically `16px`
$rem-value: strip-units($value) * .0625; // Assumes the browser default, typically `16px`
@return #{$rem-value}rem;
}
// End mod

0 comments on commit 0e03ca3

Please sign in to comment.