From 6fcca275e6545991a5135d2269088a0a337b5bdc Mon Sep 17 00:00:00 2001 From: Michael Hellein Date: Wed, 6 Aug 2014 10:15:33 -0400 Subject: [PATCH 1/5] Changed compass Sass to use not as function. This is "not" ideal, but it's necessary because of https://github.com/sass/libsass/issues/368 --- lib/compass/css3/_appearance.scss | 2 +- lib/compass/css3/_background-clip.scss | 14 +++++----- lib/compass/css3/_background-origin.scss | 10 +++---- lib/compass/css3/_background-size.scss | 2 +- lib/compass/css3/_border-radius.scss | 28 ++++++++++---------- lib/compass/css3/_box-shadow.scss | 2 +- lib/compass/css3/_box-sizing.scss | 2 +- lib/compass/css3/_box.scss | 18 ++++++------- lib/compass/css3/_columns.scss | 24 ++++++++--------- lib/compass/css3/_filter.scss | 2 +- lib/compass/css3/_hyphenation.scss | 8 +++--- lib/compass/css3/_images.scss | 2 +- lib/compass/css3/_regions.scss | 4 +-- lib/compass/css3/_transform-legacy.scss | 4 +-- lib/compass/css3/_transform.scss | 16 +++++------ lib/compass/css3/_transition.scss | 8 +++--- lib/compass/css3/_user-interface.scss | 2 +- lib/compass/typography/_vertical_rhythm.scss | 12 ++++----- lib/compass/typography/text/_ellipsis.scss | 6 ++--- lib/compass/utilities/sprites/_base.scss | 2 +- 20 files changed, 84 insertions(+), 84 deletions(-) diff --git a/lib/compass/css3/_appearance.scss b/lib/compass/css3/_appearance.scss index e238f01..87c7251 100644 --- a/lib/compass/css3/_appearance.scss +++ b/lib/compass/css3/_appearance.scss @@ -11,6 +11,6 @@ @mixin appearance($ap) { $ap: unquote($ap); @include experimental(appearance, $ap, - -moz, -webkit, not -o, not -ms, not -khtml, official + -moz, -webkit, not(-o), not(-ms), not(-khtml), official ); } diff --git a/lib/compass/css3/_background-clip.scss b/lib/compass/css3/_background-clip.scss index 6ce473f..3c05ee5 100644 --- a/lib/compass/css3/_background-clip.scss +++ b/lib/compass/css3/_background-clip.scss @@ -27,16 +27,16 @@ $default-background-clip: padding-box !default; @include experimental(background-clip, $deprecated, -moz, -webkit, - not -o, - not -ms, - not -khtml, + not(-o), + not(-ms), + not(-khtml), not official ); @include experimental(background-clip, $clip, - not -moz, - not -webkit, - not -o, - not -ms, + not(-moz), + not(-webkit), + not(-o), + not(-ms), -khtml, official ); diff --git a/lib/compass/css3/_background-origin.scss b/lib/compass/css3/_background-origin.scss index bc8eaa8..eefd262 100644 --- a/lib/compass/css3/_background-origin.scss +++ b/lib/compass/css3/_background-origin.scss @@ -26,14 +26,14 @@ $default-background-origin: content-box !default; @include experimental(background-origin, $deprecated, -moz, -webkit, - not -o, - not -ms, - not -khtml, + not(-o), + not(-ms), + not(-khtml), not official ); @include experimental(background-origin, $origin, - not -moz, - not -webkit, + not(-moz), + not(-webkit), -o, -ms, -khtml, diff --git a/lib/compass/css3/_background-size.scss b/lib/compass/css3/_background-size.scss index 9d36447..5e46ae3 100644 --- a/lib/compass/css3/_background-size.scss +++ b/lib/compass/css3/_background-size.scss @@ -22,5 +22,5 @@ $default-background-size: 100% auto !default; ) { $size-1: if(type-of($size-1) == string, unquote($size-1), $size-1); $sizes: compact($size-1, $size-2, $size-3, $size-4, $size-5, $size-6, $size-7, $size-8, $size-9, $size-10); - @include experimental(background-size, $sizes, -moz, -webkit, -o, not -ms, not -khtml); + @include experimental(background-size, $sizes, -moz, -webkit, -o, not(-ms), not(-khtml)); } diff --git a/lib/compass/css3/_border-radius.scss b/lib/compass/css3/_border-radius.scss index 2da9022..3bfd041 100644 --- a/lib/compass/css3/_border-radius.scss +++ b/lib/compass/css3/_border-radius.scss @@ -42,18 +42,18 @@ $default-border-radius: 5px !default; // Webkit doesn't understand the official shorthand syntax for specifying // a vertical radius unless so in case there's several we only take the first. @include experimental(border-radius, first-value-of($radius) first-value-of($vertical-radius), - not -moz, + not(-moz), -webkit, - not -o, - not -ms, - not -khtml, + not(-o), + not(-ms), + not(-khtml), not official ); @include experimental("border-radius", $radius unquote("/") $vertical-radius, -moz, - not -webkit, - not -o, - not -ms, + not(-webkit), + not(-o), + not(-ms), -khtml, official ); @@ -72,17 +72,17 @@ $default-border-radius: 5px !default; // Support for mozilla's syntax for specifying a corner @include experimental("border-radius-#{$vert}#{$horz}", $radius, -moz, - not -webkit, - not -o, - not -ms, - not -khtml, + not(-webkit), + not(-o), + not(-ms), + not(-khtml), not official ); @include experimental("border-#{$vert}-#{$horz}-radius", $radius, - not -moz, + not(-moz), -webkit, - not -o, - not -ms, + not(-o), + not(-ms), -khtml, official ); diff --git a/lib/compass/css3/_box-shadow.scss b/lib/compass/css3/_box-shadow.scss index ea47dc9..7e43836 100644 --- a/lib/compass/css3/_box-shadow.scss +++ b/lib/compass/css3/_box-shadow.scss @@ -45,7 +45,7 @@ $default-box-shadow-inset : false !default; } $shadow : compact($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10); @include experimental(box-shadow, $shadow, - -moz, -webkit, not -o, not -ms, not -khtml, official + -moz, -webkit, not(-o), not(-ms), not(-khtml), official ); } diff --git a/lib/compass/css3/_box-sizing.scss b/lib/compass/css3/_box-sizing.scss index 93ff8ac..f75a783 100644 --- a/lib/compass/css3/_box-sizing.scss +++ b/lib/compass/css3/_box-sizing.scss @@ -8,6 +8,6 @@ @mixin box-sizing($bs) { $bs: unquote($bs); @include experimental(box-sizing, $bs, - -moz, -webkit, not -o, not -ms, not -khtml, official + -moz, -webkit, not(-o), not(-ms), not(-khtml), official ); } diff --git a/lib/compass/css3/_box.scss b/lib/compass/css3/_box.scss index 959ccff..eac53c9 100644 --- a/lib/compass/css3/_box.scss +++ b/lib/compass/css3/_box.scss @@ -3,7 +3,7 @@ // display:box; must be used for any of the other flexbox mixins to work properly @mixin display-box { @include experimental-value(display, box, - -moz, -webkit, not -o, -ms, not -khtml, official + -moz, -webkit, not(-o), -ms, not(-khtml), official ); } @@ -16,7 +16,7 @@ $default-box-orient: horizontal !default; ) { $orientation : unquote($orientation); @include experimental(box-orient, $orientation, - -moz, -webkit, not -o, -ms, not -khtml, official + -moz, -webkit, not(-o), -ms, not(-khtml), official ); } @@ -29,7 +29,7 @@ $default-box-align: stretch !default; ) { $alignment : unquote($alignment); @include experimental(box-align, $alignment, - -moz, -webkit, not -o, -ms, not -khtml, official + -moz, -webkit, not(-o), -ms, not(-khtml), official ); } @@ -43,7 +43,7 @@ $default-box-flex: 0 !default; $flex: $default-box-flex ) { @include experimental(box-flex, $flex, - -moz, -webkit, not -o, -ms, not -khtml, official + -moz, -webkit, not(-o), -ms, not(-khtml), official ); } @@ -55,7 +55,7 @@ $default-box-flex-group: 1 !default; $group: $default-box-flex-group ) { @include experimental(box-flex-group, $group, - -moz, -webkit, not -o, -ms, not -khtml, official + -moz, -webkit, not(-o), -ms, not(-khtml), official ); } @@ -67,7 +67,7 @@ $default-box-ordinal-group: 1 !default; $group: $default-ordinal-flex-group ) { @include experimental(box-ordinal-group, $group, - -moz, -webkit, not -o, -ms, not -khtml, official + -moz, -webkit, not(-o), -ms, not(-khtml), official ); } @@ -80,7 +80,7 @@ $default-box-direction: normal !default; ) { $direction: unquote($direction); @include experimental(box-direction, $direction, - -moz, -webkit, not -o, -ms, not -khtml, official + -moz, -webkit, not(-o), -ms, not(-khtml), official ); } @@ -93,7 +93,7 @@ $default-box-lines: single !default; ) { $lines: unquote($lines); @include experimental(box-lines, $lines, - -moz, -webkit, not -o, -ms, not -khtml, official + -moz, -webkit, not(-o), -ms, not(-khtml), official ); } @@ -106,6 +106,6 @@ $default-box-pack: start !default; ) { $pack: unquote($pack); @include experimental(box-pack, $pack, - -moz, -webkit, not -o, -ms, not -khtml, official + -moz, -webkit, not(-o), -ms, not(-khtml), official ); } \ No newline at end of file diff --git a/lib/compass/css3/_columns.scss b/lib/compass/css3/_columns.scss index 9af9982..b7a6a57 100644 --- a/lib/compass/css3/_columns.scss +++ b/lib/compass/css3/_columns.scss @@ -7,35 +7,35 @@ // @include columns(20em 2) @mixin columns($width-and-count) { @include experimental(columns, $width-and-count, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } // Specify the number of columns @mixin column-count($count) { @include experimental(column-count, $count, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } // Specify the gap between columns e.g. `20px` @mixin column-gap($width) { @include experimental(column-gap, $width, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } // Specify the width of columns e.g. `100px` @mixin column-width($width) { @include experimental(column-width, $width, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } // Specify the width of the rule between columns e.g. `1px` @mixin column-rule-width($width) { @include experimental(column-rule-width, $width, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } @@ -43,7 +43,7 @@ // This works like border-style. @mixin column-rule-style($style) { @include experimental(column-rule-style, unquote($style), - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } @@ -51,7 +51,7 @@ // This works like border-color. @mixin column-rule-color($color) { @include experimental(column-rule-color, $color, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } @@ -66,7 +66,7 @@ @mixin column-rule($width, $style: false, $color: false) { $full : -compass-space-list(compact($width, $style, $color)); @include experimental(column-rule, $full, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } @@ -83,7 +83,7 @@ // -webkit-column-break-before: always; // column-break-before: always;} @mixin column-break-before($value: auto){ - @include experimental(column-break-before, $value, not -moz, -webkit, not -o, not -ms, not -khtml, official ); + @include experimental(column-break-before, $value, not(-moz), -webkit, not(-o), not(-ms), not(-khtml), official ); } // Mixin for setting column-break-after @@ -99,7 +99,7 @@ // -webkit-column-break-after: always; // column-break-after: always; } @mixin column-break-after($value: auto){ - @include experimental(column-break-after, $value, not -moz, -webkit, not -o, not -ms, not -khtml, official ); + @include experimental(column-break-after, $value, not(-moz), -webkit, not(-o), not(-ms), not(-khtml), official ); } // Mixin for setting column-break-inside @@ -114,7 +114,7 @@ // -webkit-column-break-inside: auto; // column-break-inside: auto;} @mixin column-break-inside($value: auto){ - @include experimental(column-break-inside, $value, not -moz, -webkit, not -o, not -ms, not -khtml, official ); + @include experimental(column-break-inside, $value, not(-moz), -webkit, not(-o), not(-ms), not(-khtml), official ); } // All-purpose mixin for setting column breaks. @@ -144,5 +144,5 @@ // column-break-inside: auto;} @mixin column-break($type: before, $value: auto){ - @include experimental("column-break-#{$type}", $value, not -moz, -webkit, not -o, not -ms, not -khtml, official ); + @include experimental("column-break-#{$type}", $value, not(-moz), -webkit, not(-o), not(-ms), not(-khtml), official ); } \ No newline at end of file diff --git a/lib/compass/css3/_filter.scss b/lib/compass/css3/_filter.scss index cd6eb19..c4d8caa 100644 --- a/lib/compass/css3/_filter.scss +++ b/lib/compass/css3/_filter.scss @@ -18,6 +18,6 @@ ) { $filter : compact($filter-1, $filter-2, $filter-3, $filter-4, $filter-5, $filter-6, $filter-7, $filter-8, $filter-9, $filter-10); @include experimental(filter, $filter, - -moz, -webkit, not -o, not -ms, not -khtml, official + -moz, -webkit, not(-o), not(-ms), not(-khtml), official ); } diff --git a/lib/compass/css3/_hyphenation.scss b/lib/compass/css3/_hyphenation.scss index a4f5808..5a76586 100644 --- a/lib/compass/css3/_hyphenation.scss +++ b/lib/compass/css3/_hyphenation.scss @@ -21,16 +21,16 @@ @if $value == break-all { //Most browsers handle the break-all case the same... @include experimental(word-break, $value, - not -moz, not -webkit, not -o, -ms, not -khtml, official + not(-moz), not(-webkit), not(-o), -ms, not(-khtml), official ); //Webkit handles break-all differently... as break-word @include experimental(word-break, break-word, - not -moz, not -webkit, not -o, not -ms, not -khtml, official + not(-moz), not(-webkit), not(-o), not(-ms), not(-khtml), official ); } @else { @include experimental(word-break, $value, - not -moz, not -webkit, not -o, -ms, not -khtml, official + not(-moz), not(-webkit), not(-o), -ms, not(-khtml), official ); } } @@ -51,7 +51,7 @@ // @mixin hyphens($value: auto){ @include experimental(hyphens, $value, - -moz, -webkit, not -o, not -ms, not -khtml, official + -moz, -webkit, not(-o), not(-ms), not(-khtml), official ); } diff --git a/lib/compass/css3/_images.scss b/lib/compass/css3/_images.scss index 18cdc16..cb7983c 100644 --- a/lib/compass/css3/_images.scss +++ b/lib/compass/css3/_images.scss @@ -43,7 +43,7 @@ $background-6, $background-7, $background-8, $background-9, $background-10); $mult-bgs: -compass-list-size($backgrounds) > 1; $simple-background: if($mult-bgs or prefixed(-css2, $backgrounds), -css2(-compass-nth($backgrounds, last)), false); - @if not blank($simple-background) { background: $simple-background; } + @if not(blank($simple-background)) { background: $simple-background; } @include background($background-1, $background-2, $background-3, $background-4, $background-5, $background-6, $background-7, $background-8, $background-9, $background-10); } diff --git a/lib/compass/css3/_regions.scss b/lib/compass/css3/_regions.scss index 9b2f27c..1cd623f 100644 --- a/lib/compass/css3/_regions.scss +++ b/lib/compass/css3/_regions.scss @@ -10,13 +10,13 @@ @mixin flow-into($target) { $target: unquote($target); @include experimental(flow-into, $target, - not -moz, -webkit, not -o, -ms, not -khtml, not official + not(-moz), -webkit, not(-o), -ms, not(-khtml), not official ); } @mixin flow-from($target) { $target: unquote($target); @include experimental(flow-from, $target, - not -moz, -webkit, not -o, -ms, not -khtml, not official + not(-moz), -webkit, not(-o), -ms, not(-khtml), not official ); } \ No newline at end of file diff --git a/lib/compass/css3/_transform-legacy.scss b/lib/compass/css3/_transform-legacy.scss index ac661da..3af4795 100644 --- a/lib/compass/css3/_transform-legacy.scss +++ b/lib/compass/css3/_transform-legacy.scss @@ -8,7 +8,7 @@ @mixin apply-transform($transform) { @include experimental(transform, $transform, - -moz, -webkit, -o, not -ms, not -khtml, official + -moz, -webkit, -o, not(-ms), not(-khtml), official ); } @@ -16,7 +16,7 @@ @mixin apply-origin($origin) { @include experimental(transform-origin, $origin, - -moz, -webkit, -o, not -ms, not -khtml, official + -moz, -webkit, -o, not(-ms), not(-khtml), official ); } diff --git a/lib/compass/css3/_transform.scss b/lib/compass/css3/_transform.scss index ecd50b7..20a5ad6 100644 --- a/lib/compass/css3/_transform.scss +++ b/lib/compass/css3/_transform.scss @@ -104,11 +104,11 @@ $default-skew-y : 5deg !default; $only3d: $only3d or -compass-list-size(-compass-list($origin)) > 2; @if $only3d { @include experimental(transform-origin, $origin, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } @else { @include experimental(transform-origin, $origin, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } } @@ -147,11 +147,11 @@ $default-skew-y : 5deg !default; ) { @if $only3d { @include experimental(transform, $transform, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } @else { @include experimental(transform, $transform, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } } @@ -179,7 +179,7 @@ $default-skew-y : 5deg !default; // values from 500 to 1000 are more-or-less "normal" - a good starting-point. @mixin perspective($p) { @include experimental(perspective, $p, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } @@ -190,7 +190,7 @@ $default-skew-y : 5deg !default; // where the two arguments represent x/y coordinates @mixin perspective-origin($origin: 50%) { @include experimental(perspective-origin, $origin, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } @@ -202,7 +202,7 @@ $default-skew-y : 5deg !default; // Browsers default to `flat`, mixin defaults to `preserve-3d`. @mixin transform-style($style: preserve-3d) { @include experimental(transform-style, $style, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } @@ -214,7 +214,7 @@ $default-skew-y : 5deg !default; // Browsers default to visible, mixin defaults to hidden @mixin backface-visibility($visibility: hidden) { @include experimental(backface-visibility, $visibility, - -moz, -webkit, -o, -ms, not -khtml, official + -moz, -webkit, -o, -ms, not(-khtml), official ); } diff --git a/lib/compass/css3/_transition.scss b/lib/compass/css3/_transition.scss index 4c4cb8c..14c6e67 100644 --- a/lib/compass/css3/_transition.scss +++ b/lib/compass/css3/_transition.scss @@ -68,7 +68,7 @@ $transitionable-prefixed-values: transform, transform-origin !default; @if type-of($duration-1) == string { $duration-1: unquote($duration-1); } $durations: compact($duration-1, $duration-2, $duration-3, $duration-4, $duration-5, $duration-6, $duration-7, $duration-8, $duration-9, $duration-10); @include experimental(transition-duration, $durations, - -moz, -webkit, -o, not -ms, not -khtml, official + -moz, -webkit, -o, not(-ms), not(-khtml), official ); } @@ -92,7 +92,7 @@ $transitionable-prefixed-values: transform, transform-origin !default; $function-1: unquote($function-1); $functions: compact($function-1, $function-2, $function-3, $function-4, $function-5, $function-6, $function-7, $function-8, $function-9, $function-10); @include experimental(transition-timing-function, $functions, - -moz, -webkit, -o, not -ms, not -khtml, official + -moz, -webkit, -o, not(-ms), not(-khtml), official ); } @@ -115,7 +115,7 @@ $transitionable-prefixed-values: transform, transform-origin !default; @if type-of($delay-1) == string { $delay-1: unquote($delay-1); } $delays: compact($delay-1, $delay-2, $delay-3, $delay-4, $delay-5, $delay-6, $delay-7, $delay-8, $delay-9, $delay-10); @include experimental(transition-delay, $delays, - -moz, -webkit, -o, not -ms, not -khtml, official + -moz, -webkit, -o, not(-ms), not(-khtml), official ); } @@ -214,7 +214,7 @@ $transitionable-prefixed-values: transform, transform-origin !default; // Checks if the value given is a unit of time. @function is-time($value) { @if type-of($value) == number { - @return not not index(s ms, unit($value)); + @return not(not(index(s ms, unit($value)))); } @else { @return false; } diff --git a/lib/compass/css3/_user-interface.scss b/lib/compass/css3/_user-interface.scss index e78b2fe..5f41752 100644 --- a/lib/compass/css3/_user-interface.scss +++ b/lib/compass/css3/_user-interface.scss @@ -12,6 +12,6 @@ @mixin user-select($select) { $select: unquote($select); @include experimental(user-select, $select, - -moz, -webkit, not -o, not -ms, -khtml, official + -moz, -webkit, not(-o), not(-ms), -khtml, official ); } diff --git a/lib/compass/typography/_vertical_rhythm.scss b/lib/compass/typography/_vertical_rhythm.scss index baef446..066af3c 100644 --- a/lib/compass/typography/_vertical_rhythm.scss +++ b/lib/compass/typography/_vertical_rhythm.scss @@ -46,10 +46,10 @@ $base-half-leader: $base-leader / 2; // True if a number has an absolute unit. @function absolute-unit($number) { - @return not (relative-unit($number) or unitless($number)); + @return not(relative-unit($number) or unitless($number)); } -@if $relative-font-sizing and not relative-unit($font-unit) { +@if $relative-font-sizing and not(relative-unit($font-unit)) { @warn "$relative-font-sizing is true but $font-unit is set to #{$font-unit} which is not a relative unit."; } @@ -93,7 +93,7 @@ $base-half-leader: $base-leader / 2; // defaults to the smallest integer that is large enough to fit the font. // Use $from-size to adjust from a font-size other than the base font-size. @mixin adjust-font-size-to($to-size, $lines: lines-for-font-size($to-size), $from-size: $base-font-size) { - @if not $relative-font-sizing and $from-size != $base-font-size { + @if not($relative-font-sizing) and $from-size != $base-font-size { @warn "$relative-font-sizing is false but a relative font size was passed to adjust-font-size-to"; } font-size: $font-unit * $to-size / $from-size; @@ -114,7 +114,7 @@ $base-half-leader: $base-leader / 2; $font-size: $base-font-size, $offset: 0 ) { - @if not $relative-font-sizing and $font-size != $base-font-size { + @if not($relative-font-sizing) and $font-size != $base-font-size { @warn "$relative-font-sizing is false but a relative font size was passed to the rhythm function"; } $rhythm: $font-unit * ($lines * $base-line-height - $offset) / $font-size; @@ -177,7 +177,7 @@ $base-half-leader: $base-leader / 2; // Apply a border and whitespace to any side without destroying the vertical // rhythm. The whitespace must be greater than the width of the border. @mixin apply-side-rhythm-border($side, $width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { - @if not $relative-font-sizing and $font-size != $base-font-size { + @if not($relative-font-sizing) and $font-size != $base-font-size { @warn "$relative-font-sizing is false but a relative font size was passed to apply-side-rhythm-border"; } border-#{$side}: { @@ -189,7 +189,7 @@ $base-half-leader: $base-leader / 2; // Apply borders and whitespace equally to all sides. @mixin rhythm-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { - @if not $relative-font-sizing and $font-size != $base-font-size { + @if not($relative-font-sizing) and $font-size != $base-font-size { @warn "$relative-font-sizing is false but a relative font size was passed to rhythm-borders"; } border: { diff --git a/lib/compass/typography/text/_ellipsis.scss b/lib/compass/typography/text/_ellipsis.scss index d380afb..04de955 100644 --- a/lib/compass/typography/text/_ellipsis.scss +++ b/lib/compass/typography/text/_ellipsis.scss @@ -12,11 +12,11 @@ $use-mozilla-ellipsis-binding: false !default; @if $no-wrap { white-space: nowrap; } overflow: hidden; @include experimental(text-overflow, ellipsis, - not -moz, - not -webkit, + not(-moz), + not(-webkit), -o, -ms, - not -khtml, + not(-khtml), official ); @if $experimental-support-for-mozilla and $use-mozilla-ellipsis-binding { diff --git a/lib/compass/utilities/sprites/_base.scss b/lib/compass/utilities/sprites/_base.scss index 1b268a8..ef8feb6 100644 --- a/lib/compass/utilities/sprites/_base.scss +++ b/lib/compass/utilities/sprites/_base.scss @@ -29,7 +29,7 @@ $disable-magic-sprite-selectors:false !default; @if $dimensions { @include sprite-dimensions($map, $sprite); } - @if not $disable-magic-sprite-selectors { + @if not($disable-magic-sprite-selectors) { @include sprite-selectors($map, $sprite, $sprite, $offset-x, $offset-y); } } From 25a172bbc3207c417eeb1eb1b8cb875a4a03fb81 Mon Sep 17 00:00:00 2001 From: Michael Hellein Date: Wed, 6 Aug 2014 10:16:10 -0400 Subject: [PATCH 2/5] Provided SassScript version of some Compass Ruby functions. --- README.markdown | 6 ++++ lib/_functions.scss | 1 + lib/functions/lists.scss | 53 ++++++++++++++++++++++++++++++ test/functionsSpec.js | 69 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 lib/_functions.scss create mode 100644 lib/functions/lists.scss create mode 100644 test/functionsSpec.js diff --git a/README.markdown b/README.markdown index 3fd577e..62871fb 100644 --- a/README.markdown +++ b/README.markdown @@ -1,6 +1,12 @@ # Compass SASS Stylesheets This is a repository to pull SASS style sheets on bower, and enjoy the compass mixins by using libsass for faster compilation. I made no modifications to the original stylesheets from the [original repository](https://github.com/chriseppstein/compass.git) +# Compass Ruby Functions + +This project includes reasonably similar implementations of some of the Ruby functions that Compass provides as Sass extensions. These are used in some Compass mixins, such as `@include background()`. + +To make those functions available to your compass mixins, you'll want to import the included `_functions.scss` before `_compass.scss`. + ## License Copyright (c) 2008-2009 Christopher M. Eppstein
All Rights Reserved.
diff --git a/lib/_functions.scss b/lib/_functions.scss new file mode 100644 index 0000000..e57e52f --- /dev/null +++ b/lib/_functions.scss @@ -0,0 +1 @@ +@import "functions/lists"; diff --git a/lib/functions/lists.scss b/lib/functions/lists.scss new file mode 100644 index 0000000..a118e6a --- /dev/null +++ b/lib/functions/lists.scss @@ -0,0 +1,53 @@ +/* + * A partial implementation of the Ruby list functions from Compass: + * https://github.com/Compass/compass/blob/stable/lib/compass/sass_extensions/functions/lists.rb + */ + + +// compact is part of libsass + +@function -compass-nth($list, $place) { + // Yep, Sass-lists are 1-indexed. + @if $place == "first" { + $place: 1; + } + @if $place == "last" { + $place: length($list); + } + @return nth($list, $place); +} + +// compass_list and compass_space_list can't be implemented in sass script + +@function -compass-list-size($list) { + @return length($list); +} + +@function -compass-slice($list, $start, $end: false) { + @if $end == false { + $end: length($list); + } + $full: nth($list, $start); + @for $i from $start + 1 through $end { + $full: $full, nth($list, $i); + } + @return $full; +} + +@function reject($list, $reject1, $reject2:null, $reject3:null, $reject4:null, $reject5:null, $reject6:null, $reject7:null, $reject8:null, $reject9:null) { + $rejects: $reject1, $reject2, $reject3, $reject4, $reject5, $reject6, $reject7, $reject8, $reject9; + + $full: false; + @each $item in $list { + @if index($rejects, $item) {} + @else { + @if $full { + $full: $full, $item; + } + @else { + $full: $item; + } + } + } + @return $full; +} diff --git a/test/functionsSpec.js b/test/functionsSpec.js new file mode 100644 index 0000000..1b09b31 --- /dev/null +++ b/test/functionsSpec.js @@ -0,0 +1,69 @@ +var sass = require('node-sass'); +var chalk = require('chalk'); + +var libDir = __dirname.replace(/test$/, 'lib'); + +var render = function(data, callback) { + sass.render({ + data: '@import "'+libDir+'/functions";' + data, + outputStyle: 'compressed', + success: function(output){ + callback(output); + }, + error: function(err){ + console.log(chalk.red("Sass error:"), err); + callback('', err); + } + }); +} + +var property = function(prop) { + return 'a{b:'+prop+';}'; +} + +describe("Functions", function () { + + // This is verifying a function that's part of libsass that Compass also provided. + it("should compact a list with false values", function (done) { + render(property('compact(one,false,three)'), function(output, err) { + expect(output).toBe(property('one,three')); + done(); + }); + }); + + it("should calculate a list length", function(done) { + render('$list: one, two;' + property('-compass-list-size($list)'), function(output, err) { + expect(output).toBe(property('2')); + done(); + }); + }); + + it("should calculate a list length with a space delimiter", function(done) { + render('$list: one two;' + property('-compass-list-size($list)'), function(output, err) { + expect(output).toBe(property('2')); + done(); + }); + }); + + it("should slice a list", function(done) { + render('$list: one, two, three, four;' + property('-compass-slice($list, 2, 3)'), function(output, err) { + expect(output).toBe(property('two,three')); + done(); + }); + }); + + it("should slice a list to the end", function(done) { + render('$list: one, two, three, four;' + property('-compass-slice($list, 2)'), function(output, err) { + expect(output).toBe(property('two,three,four')); + done(); + }); + }); + + it("should reject values from a list", function(done) { + render('$list: one, two, three, four;' + property('reject($list, two, four)'), function(output, err) { + expect(output).toBe(property('one,three')); + done(); + }); + }); + +}); From 48f63f7b8d721dc6fc30d5089ba2caba30fca90d Mon Sep 17 00:00:00 2001 From: Michael Hellein Date: Wed, 6 Aug 2014 10:20:08 -0400 Subject: [PATCH 3/5] Updated Readme to reflect that some .scss files are changed. --- README.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 62871fb..474435e 100644 --- a/README.markdown +++ b/README.markdown @@ -1,7 +1,8 @@ # Compass SASS Stylesheets -This is a repository to pull SASS style sheets on bower, and enjoy the compass mixins by using libsass for faster compilation. I made no modifications to the original stylesheets from the [original repository](https://github.com/chriseppstein/compass.git) -# Compass Ruby Functions +This is a repository to pull SASS style sheets on Bower, and enjoy the compass mixins by using libsass for faster compilation. This project makes minimal modifications to the original stylesheets from the [original repository](https://github.com/Compass/compass/tree/stable/frameworks/compass/stylesheets), intented to improve libsass compatibility and not change output. + +## Compass Ruby Functions This project includes reasonably similar implementations of some of the Ruby functions that Compass provides as Sass extensions. These are used in some Compass mixins, such as `@include background()`. From 0bb8e8ad40f7c51cf238c57f321a9dd13c7752cb Mon Sep 17 00:00:00 2001 From: Michael Hellein Date: Wed, 6 Aug 2014 16:22:36 -0400 Subject: [PATCH 4/5] Relocated sassscript functions to compass dir. This location seems to provide a better API for imports, even if it does intermingle our changes with Compass a bit. --- README.markdown | 2 +- lib/_compass.scss | 1 + lib/{ => compass}/_functions.scss | 0 lib/{functions/lists.scss => compass/functions/_lists.scss} | 0 4 files changed, 2 insertions(+), 1 deletion(-) rename lib/{ => compass}/_functions.scss (100%) rename lib/{functions/lists.scss => compass/functions/_lists.scss} (100%) diff --git a/README.markdown b/README.markdown index 474435e..12ce385 100644 --- a/README.markdown +++ b/README.markdown @@ -6,7 +6,7 @@ This is a repository to pull SASS style sheets on Bower, and enjoy the compass m This project includes reasonably similar implementations of some of the Ruby functions that Compass provides as Sass extensions. These are used in some Compass mixins, such as `@include background()`. -To make those functions available to your compass mixins, you'll want to import the included `_functions.scss` before `_compass.scss`. +To make those functions available to your compass mixins, you'll want to either `@import "compass";` or `@import "compass/functions"'` before the specific compass scss files you import. ## License Copyright (c) 2008-2009 Christopher M. Eppstein
diff --git a/lib/_compass.scss b/lib/_compass.scss index 9b741c0..f8a53de 100644 --- a/lib/_compass.scss +++ b/lib/_compass.scss @@ -1,3 +1,4 @@ +@import "compass/functions"; @import "compass/utilities"; @import "compass/typography"; @import "compass/css3"; diff --git a/lib/_functions.scss b/lib/compass/_functions.scss similarity index 100% rename from lib/_functions.scss rename to lib/compass/_functions.scss diff --git a/lib/functions/lists.scss b/lib/compass/functions/_lists.scss similarity index 100% rename from lib/functions/lists.scss rename to lib/compass/functions/_lists.scss From a744b1c853bebad08b9f7d7577db4079cf0c414b Mon Sep 17 00:00:00 2001 From: Michael Hellein Date: Wed, 6 Aug 2014 16:25:21 -0400 Subject: [PATCH 5/5] Updated tests to reflect relocation of functions. --- test/functionsSpec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functionsSpec.js b/test/functionsSpec.js index 1b09b31..7a26c68 100644 --- a/test/functionsSpec.js +++ b/test/functionsSpec.js @@ -5,7 +5,7 @@ var libDir = __dirname.replace(/test$/, 'lib'); var render = function(data, callback) { sass.render({ - data: '@import "'+libDir+'/functions";' + data, + data: '@import "'+libDir+'/compass/functions";' + data, outputStyle: 'compressed', success: function(output){ callback(output);