Skip to content

Instantly share code, notes, and snippets.

@dmitry-valkov
dmitry-valkov / dynamic-width.scss
Created September 18, 2019 18:55
SCSS mixin for generate min/max and responsive width based on screen size.
/// Remove the unit of a length
/// @param {Number} $number - Number to remove unit from
/// @return {Number} - Unitless number
@function stripUnit($number) {
@if type-of($number) == 'number' and not unitless($number) {
@return $number / ($number * 0 + 1);
}
@return $number;
}