sass/susy/language/susy/_isolate.scss in susy-2.0.0.beta.1 vs sass/susy/language/susy/_isolate.scss in susy-2.0.0.beta.2
- old
+ new
@@ -1,31 +1,53 @@
// Isolation Syntax
// ================
-// Isolate
-// -------
+
+// Isolate [Mixin]
+// ---------------
// Set isolation as an override.
-// - $input : <span>
+// - $location: <span>
@mixin isolate(
- $input: first
+ $isolate: 1
) {
- $input : parse-span($input);
- $output : (
- push: get-isolation($input),
- flow: susy-get(flow, $input),
+ $output: (
+ push: isolate($isolate),
+ flow: susy-get(flow, $isolate),
);
@include isolate-output($output...);
}
+
+// Isolate [function]
+// ------------------
+// Return an isolation offset width.
+// - $location: <span>
+@function isolate(
+ $isolate: 1
+) {
+ $isolate: parse-span($isolate);
+ $isolation: susy-get(span, $isolate);
+
+ @if $isolation and not get-location($isolate) {
+ $new: (
+ span: null,
+ location: $isolation,
+ );
+ $isolate: map-merge($isolate, $new);
+ }
+
+ @return get-isolation($isolate);
+}
+
+
// Get Isolation
// -------------
// Return the isolation offset width
// - $input: <map>
@function get-isolation(
$input
) {
- $span : susy-get(span, $input);
$location : get-location($input);
$columns : susy-get(columns, $input);
$width : null;
@if type-of($location) == number and not unitless($location) {