/// Calculate REM based on base font size
/// @param string $size Size in pixels
/// @return string Size in REM
@function calculateRem($size) {
    $remSize: $size / $font-size-base;
    @return $remSize * 1rem;
}

/// Get setting from option map
/// @param string $setting Key
/// @return string Setting
@function setting($setting: "") {
    @return map-get($settings, $setting);
}

/// Create a breakpoint
/// @param string $fromThisSize Lower limit in pixels
/// @param string $uptoThisSize Upper limit in pixels
/// @return string Media query
@function createBreakpoint($fromThisSize: "", $uptoThisSize: ""){
    $query: "";

    @if $fromThisSize != "" or $uptoThisSize != "" {

        @if $fromThisSize != "" and $fromThisSize != 0  {
            $query: $query + "(min-width:#{$fromThisSize})";
        }

        @if ($fromThisSize != "" and $fromThisSize != 0) and $uptoThisSize != "" {
            $query: $query + " and ";
        }

        @if $uptoThisSize != "" {
            $query: $query + "(max-width:#{$uptoThisSize})";
        }

        @return unquote($query);
    }
}
