Skip to content

Commit

Permalink
extensions testable
Browse files Browse the repository at this point in the history
compass stylesheets update
bug: compass linear gradient, implemented missing functions
  • Loading branch information
frederikbosch committed Sep 20, 2013
1 parent 38b33f6 commit 0d3a904
Show file tree
Hide file tree
Showing 89 changed files with 1,548 additions and 1,311 deletions.
105 changes: 98 additions & 7 deletions Extensions/Compass/Compass.php
Expand Up @@ -89,12 +89,12 @@ public static function getFilesArray($root)
$root = ($last_letter == '\\' || $last_letter == '/') ? $root : $root . DIRECTORY_SEPARATOR;

$directories[] = $root;

while (sizeof($directories)) {
$dir = array_pop($directories);
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file == '.' || $file == '..') {
if ($file == '.' || $file == '..' || substr($file,0,1)=='.') {
continue;
}
$file = $dir . $file;
Expand Down Expand Up @@ -152,7 +152,7 @@ public static function compassResolvePath($file)
if ($path) {
return $path;
}

return false;
}

Expand Down Expand Up @@ -444,10 +444,101 @@ public static function compassCommaList()
print_r(func_get_args());
die;
}

public static function compassPrefixedForTransition($prefix, $property)
{


public static function compassPrefixed ($prefix, $list) {
$list = static::compassList( $list );
$prefix = trim ( preg_replace ( '/[^a-z]/', '', strtolower ( $prefix ) ) );

$reqs = array (
'pie' => array (
'border-radius',
'box-shadow',
'border-image',
'background',
'linear-gradient'
),
'webkit' => array (
'background-clip',
'background-origin',
'border-radius',
'box-shadow',
'box-sizing',
'columns',
'gradient',
'linear-gradient',
'text-stroke'
),
'moz' => array (
'background-size',
'border-radius',
'box-shadow',
'box-sizing',
'columns',
'gradient',
'linear-gradient'
),
'o' => array (
'background-origin',
'text-overflow'
)
);
foreach ( $list as $item ) {
$aspect = trim ( current ( explode ( '(', $item ) ) );
if (isset ( $reqs [$prefix] ) && in_array ( $aspect, $reqs [$prefix] )) {
return new SassBoolean ( TRUE );
}
}
return new SassBoolean ( FALSE );
}

public static function compassPrefix ($vendor, $input) {
if (is_object($vendor)) {
$vendor = $vendor->value;
}

$list = static::compassList($input, ',');
$output = '';
foreach($list as $key=>$value) {
$list[$key] = '-' . $vendor . '-' . $value;
}
return new SassString(implode(', ', $list));
}

public static function compassWebkit ($input) {
return static::compassPrefix('webkit', $input);
}

public static function compassMoz ($input) {
return static::compassPrefix('moz', $input);
}

public static function compassO ($input) {
return static::compassPrefix('o', $input);
}

public static function compassMs ($input) {
return static::compassPrefix('ms', $input);
}

public static function compassSvg ($input) {
return static::compassPrefix('svg', $input);
}

public static function compassPie ($input) {
return static::compassPrefix('ms', $input);
}

public static function compassCss2 ($input) {
return static::compassPrefix('ms', $input);
}

public static function compassOwg ($input) {
return static::compassPrefix('ms', $input);
}

public static function compassPrefixedForTransition($prefix, $list)
{

}

public static function compassPi()
Expand Down
6 changes: 3 additions & 3 deletions Extensions/Compass/stylesheets/_compass.scss 100755 → 100644
@@ -1,3 +1,3 @@
@import "compass/compass/utilities";
@import "compass/compass/_typography";
@import "compass/compass/_css3";
@import "compass/utilities";
@import "compass/typography";
@import "compass/css3";
5 changes: 3 additions & 2 deletions Extensions/Compass/stylesheets/_lemonade.scss 100755 → 100644
Expand Up @@ -8,15 +8,16 @@
}

@mixin sized-sprite-image($file) {
background: sprite-image($file);
background: sprite-image($file);
@include image-dimensions($file);
}

@mixin sprite-folder($folder, $image-dimensions: false) {
.#{$folder} {
@if $image-dimensions {
background: sprite-url($folder);
} @else {
}
@else {
background: sprite-url($folder) no-repeat;
}
}
Expand Down
40 changes: 20 additions & 20 deletions Extensions/Compass/stylesheets/compass/_css3.scss 100755 → 100644
@@ -1,20 +1,20 @@
@import "css3/css3/_border-radius";
@import "css3/css3/_inline-block";
@import "css3/css3/_opacity";
@import "css3/css3/_box-shadow";
@import "css3/css3/_text-shadow";
@import "css3/css3/_columns";
@import "css3/css3/_box-sizing";
@import "css3/css3/_box";
@import "css3/css3/_images";
@import "css3/css3/_background-clip";
@import "css3/css3/_background-origin";
@import "css3/css3/_background-size";
@import "css3/css3/_font-face";
@import "css3/css3/_transform";
@import "css3/css3/_transition";
@import "css3/css3/_appearance";
@import "css3/css3/_regions";
@import "css3/css3/_hyphenation";
@import "css3/css3/_filter";
@import "css3/css3/_user-interface";
@import "css3/border-radius";
@import "css3/inline-block";
@import "css3/opacity";
@import "css3/box-shadow";
@import "css3/text-shadow";
@import "css3/columns";
@import "css3/box-sizing";
@import "css3/box";
@import "css3/images";
@import "css3/background-clip";
@import "css3/background-origin";
@import "css3/background-size";
@import "css3/font-face";
@import "css3/transform";
@import "css3/transition";
@import "css3/appearance";
@import "css3/regions";
@import "css3/hyphenation";
@import "css3/filter";
@import "css3/user-interface";
6 changes: 3 additions & 3 deletions Extensions/Compass/stylesheets/compass/_layout.scss 100755 → 100644
@@ -1,3 +1,3 @@
@import "layout/layout/_grid-background";
@import "layout/layout/_sticky-footer";
@import "layout/layout/_stretching";
@import "layout/grid-background";
@import "layout/sticky-footer";
@import "layout/stretching";
2 changes: 1 addition & 1 deletion Extensions/Compass/stylesheets/compass/_reset-legacy.scss 100755 → 100644
@@ -1,3 +1,3 @@
@import "reset/reset/_utilities-legacy";
@import "reset/utilities-legacy";

@include global-reset;
2 changes: 1 addition & 1 deletion Extensions/Compass/stylesheets/compass/_reset.scss 100755 → 100644
@@ -1,3 +1,3 @@
@import "reset/reset/_utilities";
@import "reset/utilities";

@include global-reset;
16 changes: 8 additions & 8 deletions Extensions/Compass/stylesheets/compass/_support.scss 100755 → 100644
Expand Up @@ -21,20 +21,20 @@ $legacy-support-for-ie: $legacy-support-for-ie6 or $legacy-support-for-ie7 or $l
$legacy-support-for-mozilla: true;

// Support for mozilla in experimental css3 properties (-moz).
$experimental-support-for-mozilla: true !default;
$experimental-support-for-mozilla : true !default;
// Support for webkit in experimental css3 properties (-webkit).
$experimental-support-for-webkit: true !default;
$experimental-support-for-webkit : true !default;
// Support for webkit's original (non-standard) gradient syntax.
$support-for-original-webkit-gradients: true !default;
$support-for-original-webkit-gradients : true !default;
// Support for opera in experimental css3 properties (-o).
$experimental-support-for-opera: true !default;
$experimental-support-for-opera : true !default;
// Support for microsoft in experimental css3 properties (-ms).
$experimental-support-for-microsoft: true !default;
$experimental-support-for-microsoft : true !default;
// Support for khtml in experimental css3 properties (-khtml).
$experimental-support-for-khtml: false !default;
$experimental-support-for-khtml : false !default;
// Support for svg in experimental css3 properties.
// Setting this to true might add significant size to your
// generated stylesheets.
$experimental-support-for-svg: false !default;
$experimental-support-for-svg : false !default;
// Support for CSS PIE in experimental css3 properties (-pie).
$experimental-support-for-pie: false !default;
$experimental-support-for-pie : false !default;
8 changes: 4 additions & 4 deletions Extensions/Compass/stylesheets/compass/_typography.scss 100755 → 100644
@@ -1,4 +1,4 @@
@import "typography/typography/_links";
@import "typography/typography/lists";
@import "typography/typography/_text";
@import "typography/typography/_vertical_rhythm";
@import "typography/links";
@import "typography/lists";
@import "typography/text";
@import "typography/vertical_rhythm";
15 changes: 8 additions & 7 deletions Extensions/Compass/stylesheets/compass/_utilities.scss 100755 → 100644
@@ -1,8 +1,9 @@
@import "utilities/utilities/_color";
@import "utilities/utilities/_general";
@import "utilities/utilities/_sprites";
@import "utilities/utilities/tables";
@import "utilities/color";
@import "utilities/general";
@import "utilities/sprites";
@import "utilities/tables";

// deprecated
@import "typography/typography/_links";
@import "typography/typography/lists";
@import "typography/typography/_text";
@import "typography/links";
@import "typography/lists";
@import "typography/text";
4 changes: 3 additions & 1 deletion Extensions/Compass/stylesheets/compass/css3/_appearance.scss 100755 → 100644
Expand Up @@ -11,5 +11,7 @@

@mixin appearance($ap) {
$ap: unquote($ap);
@include experimental(appearance, $ap, -moz, -webkit, not -o, not -ms, not -khtml, official);
@include experimental(appearance, $ap,
-moz, -webkit, not -o, not -ms, not -khtml, official
);
}
30 changes: 20 additions & 10 deletions Extensions/Compass/stylesheets/compass/css3/_background-clip.scss 100755 → 100644
Expand Up @@ -18,16 +18,26 @@ $default-background-clip: padding-box !default;
// * text

@mixin background-clip($clip: $default-background-clip) {
// webkit and mozilla use the deprecated short [border | padding]
// webkit and mozilla use the deprecated short [border | padding]
$clip: unquote($clip);
$deprecated: $clip;
@if $clip == padding-box {
$deprecated: padding;
}
@if $clip == border-box {
$deprecated: border;
}
// Support for webkit and mozilla's use of the deprecated short form
@include experimental(background-clip, $deprecated, -moz, -webkit, not -o, not -ms, not -khtml, not official);
@include experimental(background-clip, $clip, not -moz, not -webkit, not -o, not -ms, -khtml, official);
@if $clip == padding-box { $deprecated: padding; }
@if $clip == border-box { $deprecated: border; }
// Support for webkit and mozilla's use of the deprecated short form
@include experimental(background-clip, $deprecated,
-moz,
-webkit,
not -o,
not -ms,
not -khtml,
not official
);
@include experimental(background-clip, $clip,
not -moz,
not -webkit,
not -o,
not -ms,
-khtml,
official
);
}
35 changes: 22 additions & 13 deletions Extensions/Compass/stylesheets/compass/css3/_background-origin.scss 100755 → 100644
Expand Up @@ -13,21 +13,30 @@ $default-background-origin: content-box !default;
// * browser defaults to `padding-box`
// * mixin defaults to `content-box`


@mixin background-origin($origin: $default-background-origin) {
$origin: unquote($origin);
// webkit and mozilla use the deprecated short [border | padding | content]
// webkit and mozilla use the deprecated short [border | padding | content]
$deprecated: $origin;
@if $origin == padding-box {
$deprecated: padding;
}
@if $origin == border-box {
$deprecated: border;
}
@if $origin == content-box {
$deprecated: content;
}
@if $origin == padding-box { $deprecated: padding; }
@if $origin == border-box { $deprecated: border; }
@if $origin == content-box { $deprecated: content; }

// Support for webkit and mozilla's use of the deprecated short form
@include experimental(background-origin, $deprecated, -moz, -webkit, not -o, not -ms, not -khtml, not official);
@include experimental(background-origin, $origin, not -moz, not -webkit, -o, -ms, -khtml, official);
// Support for webkit and mozilla's use of the deprecated short form
@include experimental(background-origin, $deprecated,
-moz,
-webkit,
not -o,
not -ms,
not -khtml,
not official
);
@include experimental(background-origin, $origin,
not -moz,
not -webkit,
-o,
-ms,
-khtml,
official
);
}
22 changes: 12 additions & 10 deletions Extensions/Compass/stylesheets/compass/css3/_background-size.scss 100755 → 100644
Expand Up @@ -8,16 +8,18 @@ $default-background-size: 100% auto !default;
//
// * percentages are relative to the background-origin (default = padding-box)
// * mixin defaults to: `$default-background-size`
@mixin background-size($size-1: $default-background-size,
$size-2: false,
$size-3: false,
$size-4: false,
$size-5: false,
$size-6: false,
$size-7: false,
$size-8: false,
$size-9: false,
$size-10: false) {
@mixin background-size(
$size-1: $default-background-size,
$size-2: false,
$size-3: false,
$size-4: false,
$size-5: false,
$size-6: false,
$size-7: false,
$size-8: false,
$size-9: false,
$size-10: false
) {
$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);
Expand Down

0 comments on commit 0d3a904

Please sign in to comment.