Sha256: 4876549251a3ddd3751ab5301fc9f62fa498adb599d300825c53067c45650f5e

Contents?: true

Size: 1.3 KB

Versions: 7

Compression:

Stored size: 1.3 KB

Contents

// Calculate from-to breakpoints
// -------------------------------------------------------------------------------
// @dependence `map-fetch()`
// @dependence `get-value()`
// -------------------------------------------------------------------------------
// @param $n ["alias" | "prev" | "next"] : how to calculate breakpoint 
// @param $key [Value] : key of breakpoint
// @param $i [Value] : index of current breakpoint
// -------------------------------------------------------------------------------
// @return [Value]

@function calc-breakpoint($n, $key, $i) {
    @if $n == "alias" {
        @if get-value(settings, grid) == "fixed" {
            @if is-lowest-breakpoint($key) {
                @return 0;
            } @else {
                @return get-value($key, breakpoint);
            }
        } @else if get-value(settings, grid) == "fluid" {
            @return get-value($key, breakpoint);
        }
    } @else if $n == "next" {
        @if is-lowest-breakpoint($key) {
            @return 0;
        } @else {
            @return get-value(steal-key(($i + 1)), breakpoint);
        }
    } @else if $n == "prev" {
        @if is-highest-breakpoint($key) {
            @return get-value($key, breakpoint);
        } @else {
            @return get-value(steal-key(($i - 1)), breakpoint);
        }
    }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
flint-gs-1.3.5 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.3.4 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.3.3 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.3.2 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.3.1 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.3.0 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.2.0 stylesheets/flint/functions/lib/_calc-breakpoint.scss