Skip to content

Instantly share code, notes, and snippets.

@davidtheclark
Created August 2, 2014 18:01
Show Gist options
  • Select an option

  • Save davidtheclark/fb51878bce26e6e21e8c to your computer and use it in GitHub Desktop.

Select an option

Save davidtheclark/fb51878bce26e6e21e8c to your computer and use it in GitHub Desktop.

Revisions

  1. davidtheclark created this gist Aug 2, 2014.
    85 changes: 85 additions & 0 deletions SassMeister-input.scss
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,85 @@
    // ----
    // libsass (v2.0.0)
    // ----

    @mixin first {
    /* first mixin was included */
    body {
    font-size: 100px;
    }
    }

    @mixin second {
    /* second mixin was included */
    body {
    line-height: 2;
    }
    }

    @mixin third {
    /* third mixin was included */
    body {
    background-color: pink;
    }
    }

    @mixin everything-but ($exclude: false) {
    /* The following mixins SHOULD NOT be included: #{$exclude} */
    /* first index: #{index($exclude, first)} */
    /* second index: #{index($exclude, second)} */
    /* third index: #{index($exclude, third)} */
    @if not(index($exclude, first)) {
    @include first;
    }
    @if not(index($exclude, second)) {
    @include second;
    }
    @if not(index($exclude, third)) {
    @include third;
    }

    }

    @mixin everything-specified ($include: false) {
    /* The following mixins SHOULD be included: #{$include} */
    /* first index: #{index($include, first)} */
    /* second index: #{index($include, second)} */
    /* third index: #{index($include, third)} */
    @if (index($include, first)) {
    @include first;
    }
    @if (index($include, second)) {
    @include second;
    }
    @if (index($include, third)) {
    @include third;
    }
    }

    /* ==================
    * EVERYTHING BUT */
    @include everything-but(first second);

    /* ==================
    * EVERYTHING SPECIFIED */
    @include everything-specified(first second);

    /* ==================
    * IF-NOT TEST
    * Does simple if-not syntax work? */

    $tester: false;

    @if $tester {
    p {
    font-size: 30px;
    }
    /* No, if not didn't work. */
    }

    @if not $tester {
    p {
    font-size: 30px;
    }
    /* Yes, if-not did work. */
    }
    31 changes: 31 additions & 0 deletions SassMeister-output.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    /* ==================
    * EVERYTHING BUT */
    /* The following mixins SHOULD NOT be included: first second */
    /* first index: 1 */
    /* second index: 2 */
    /* third index: false */
    /* third mixin was included */
    body {
    background-color: pink; }

    /* ==================
    * EVERYTHING SPECIFIED */
    /* The following mixins SHOULD be included: first second */
    /* first index: 1 */
    /* second index: 2 */
    /* third index: false */
    /* first mixin was included */
    body {
    font-size: 100px; }

    /* second mixin was included */
    body {
    line-height: 2; }

    /* ==================
    * IF-NOT TEST
    * Does simple if-not syntax work? */
    p {
    font-size: 30px; }

    /* Yes, if-not did work. */