Sha256: 451ddb8bc63f3b19524f60031a2e480ee94931d6f657256e8c6b4fefde6d80f2

Contents?: true

Size: 1.59 KB

Versions: 51

Compression:

Stored size: 1.59 KB

Contents

///*------------------------------------*\
//    #TOOLS-RESPONSIVE
//\*------------------------------------*/

// Here we set a variable assuming that responsive settings are not set
// globally. If they have been previously been defined, the following variable
// will be overriden and will be set to `true`.
$inuit-responsive-settings: false !default;

@if ($inuit-responsive-settings == false) {
    @warn "Oops! Have you included a responsive settings file?"
}





// A simple mixin to quickly generate whole media queries from the aliases and
// conditions defined in `_settings.responsive.scss`.
//
// Usage:
//
// .foo {
//     color: green;
//
//     @include media-query(palm) {
//         color: red;
//     }
//
// }

@mixin media-query($mq) {

    $breakpoint-found: false;

    // Loop through the list of breakpoints we’ve provided in our settings file.
    @each $breakpoint in $breakpoints {

        // Grab the alias and the condition from their respective locations in
        // the list.
        $alias:     nth($breakpoint, 1);
        $condition: nth($breakpoint, 2);

        // If the media query we’ve specified has an alias and a condition...
        @if $mq == $alias and $condition {

            // ...tell the mixin that we’ve found it...
            $breakpoint-found: true;

            // ...and spit it out here.
            @media #{$condition} {
                @content;
            }

        }

    }

    // If the user specifies a non-exitent alias, send them a warning.
    @if $breakpoint-found == false{
        @warn "Oops! Breakpoint ‘#{$mq}’ does not exist."
    }

}

Version data entries

51 entries across 51 versions & 2 rubygems

Version Path
lanes-0.8.0 node_modules/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.55 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.54 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.53 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.52 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.51 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.50 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.49 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.48 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.47 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.46 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.45 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.44 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.43 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.42 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.41 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.40 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.39 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.38 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss
wrgem-0.0.37 lib/generators/wrstart/template/vendor/assets/components/inuit-responsive-tools/_tools.responsive.scss