mirror of
https://github.com/paboyle/Grid.git
synced 2026-09-07 18:29:36 +01:00
Refactoring of the gh pages
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
@function breakpoint-parse-default-pair($first, $second) {
|
||||
$default: breakpoint-get('default pair');
|
||||
$min: '';
|
||||
$max: '';
|
||||
|
||||
// Sort into min and max
|
||||
$min: min($first, $second);
|
||||
$max: max($first, $second);
|
||||
|
||||
// Set Context
|
||||
$context-setter: private-breakpoint-set-context(min-#{$default}, $min);
|
||||
$context-setter: private-breakpoint-set-context(max-#{$default}, $max);
|
||||
|
||||
// Make them EMs if need be
|
||||
@if (breakpoint-get('to ems') == true) {
|
||||
$min: breakpoint-to-base-em($min);
|
||||
$max: breakpoint-to-base-em($max);
|
||||
}
|
||||
|
||||
@return '(min-#{$default}: #{$min}) and (max-#{$default}: #{$max})';
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
@function breakpoint-parse-double-default($first, $second) {
|
||||
$feature: '';
|
||||
$value: '';
|
||||
|
||||
@if type-of($first) == 'string' {
|
||||
$feature: $first;
|
||||
$value: $second;
|
||||
}
|
||||
@else {
|
||||
$feature: $second;
|
||||
$value: $first;
|
||||
}
|
||||
|
||||
// Set Context
|
||||
$context-setter: private-breakpoint-set-context($feature, $value);
|
||||
|
||||
@if (breakpoint-get('to ems') == true) {
|
||||
$value: breakpoint-to-base-em($value);
|
||||
}
|
||||
|
||||
@return '(#{$feature}: #{$value})'
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
@function breakpoint-parse-double-string($first, $second) {
|
||||
$feature: '';
|
||||
$value: '';
|
||||
|
||||
// Test to see which is the feature and which is the value
|
||||
@if (breakpoint-string-value($first) == true) {
|
||||
$feature: $first;
|
||||
$value: $second;
|
||||
}
|
||||
@else if (breakpoint-string-value($second) == true) {
|
||||
$feature: $second;
|
||||
$value: $first;
|
||||
}
|
||||
@else {
|
||||
@warn "Neither #{$first} nor #{$second} is a valid media query name.";
|
||||
}
|
||||
|
||||
// Set Context
|
||||
$context-setter: private-breakpoint-set-context($feature, $value);
|
||||
|
||||
@return '(#{$feature}: #{$value})';
|
||||
}
|
||||
Reference in New Issue
Block a user