Sha256: 712c5c72c9728288bcc4a08856efc5285847963c005e9bc4d02dbd46fbb7d728

Contents?: true

Size: 1.41 KB

Versions: 6

Compression:

Stored size: 1.41 KB

Contents

// Calculate from-to breakpoints
// -------------------------------------------------------------------------------
// @dependence `map-fetch()`
// @dependence `get-value()`
// -------------------------------------------------------------------------------
// @param $n ["from | "to"] : 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 get-value(settings, grid) == "fluid" {
		@if $n == "from" {
			@if is-lowest-breakpoint($key) {
				@return 0;
			} @else {
				@return (get-value(next-index($i), breakpoint) + 1);
			}
		} @else if $n == "to" {
			@return get-value($key, breakpoint);
		}
	} @else if get-value(settings, grid) == "fixed" {
		@if $n == "from" {
			@if is-lowest-breakpoint($key) {
				@return 0;
			} @else {
				@return get-value($key, breakpoint);
			}
		} @else if $n == "alt-from" {
			@if is-lowest-breakpoint($key) {
				@return 0;
			} @else {
				@return get-value($key, breakpoint) - 1;
			}
		}@else if $n == "to" {
		  	@if steal-key($i) != steal-key(1) {
			 	@return (get-value(steal-key(($i - 1)), breakpoint) - 1);
		 	 } @else {
		    	@return (get-value(steal-key($i), breakpoint) - 1);
	    	}
		} @else if $n == "alt-to" {
			@return (get-value(steal-key($i), breakpoint));
		}
	}
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
flint-gs-1.1.0 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.0.9 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.0.8 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.0.7 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.0.6 stylesheets/flint/functions/lib/_calc-breakpoint.scss
flint-gs-1.0.5 stylesheets/flint/functions/lib/_calc-breakpoint.scss