Skip to content
Browse files

Procedural API. Updated aliases and initial values. Other small changes.

Added procedural style public API to mirror the current API
Adjusted color function parsing to accept space delimited arguments (as well as comma)
Updated aliases file with CSS3 columns, tab-size and other small changes
Updated initial values table
Disabled IE6 min-height plugin by default
  • Loading branch information...
1 parent 28dbe48 commit 4112c02f0c0f32e422ce2b89126dd8e23edec0bf @peteboere committed Jan 23, 2012
Showing with 91 additions and 10 deletions.
  1. +26 −0 Aliases.ini
  2. +10 −0 CHANGELOG
  3. +1 −1 Plugins.ini
  4. +37 −3 lib/Core.php
  5. +8 −6 lib/Function.php
  6. +9 −0 misc/initial-values.ini
View
26 Aliases.ini
@@ -98,10 +98,29 @@
box-sizing[] = -moz-box-sizing
; Columns
+ columns[] = -webkit-columns
+ columns[] = -moz-columns
column-count[] = -webkit-column-count
column-count[] = -moz-column-count
+ column-fill[] = -webkit-column-fill
+ column-fill[] = -moz-column-fill
column-gap[] = -webkit-column-gap
column-gap[] = -moz-column-gap
+ column-rule[] = -webkit-column-rule
+ column-rule[] = -moz-column-rule
+ column-rule-style[] = -webkit-column-rule-style
+ column-rule-style[] = -moz-column-rule-style
+ column-rule-width[] = -webkit-column-rule-width
+ column-rule-width[] = -moz-column-rule-width
+ column-rule-style[] = -webkit-column-rule-style
+ column-rule-style[] = -moz-column-rule-style
+ column-rule-color[] = -webkit-column-rule-color
+ column-rule-color[] = -moz-column-rule-color
+ column-span[] = -webkit-column-span
+ column-span[] = -moz-column-span
+ column-width[] = -webkit-column-width
+ column-width[] = -moz-column-width
+
; Border-image
border-image[] = -webkit-border-image
@@ -138,9 +157,15 @@
; User select (non standard)
user-select[] = -webkit-user-select
user-select[] = -moz-user-select
+ user-select[] = -ms-user-select
user-select[] = -o-user-select
user-select[] = user-select
+ ; Tab size
+ tab-size[] = -webkit-tab-size
+ tab-size[] = -moz-tab-size
+ tab-size[] = -o-tab-size
+
;----------------------------------------------------------------------------
;-- Value aliases
@@ -177,6 +202,7 @@
repeating-radial-gradient[] = -o-repeating-radial-gradient
; Calc
+ calc[] = -webkit-calc
calc[] = -moz-calc
View
10 CHANGELOG
@@ -1,3 +1,13 @@
+1.3.7
+-----
+Added initial-keyword plugin (shim for the CSS3 keyword)
+Added inline method (Issue #18)
+Added ability to escape declarations from aliasing or plugins by prefixing with tilde
+Deprecated @variables syntax for @define. @variables still supported
+Surpressed some benign PHP warning messages
+Some internal cleaning up
+
+
1.3.6
-----
Improved color functions
View
2 Plugins.ini
@@ -3,7 +3,7 @@
;----------------------------------------------------------------
; min-height shim for IE < 7
-plugins[] = ie-min-height.php
+; plugins[] = ie-min-height.php
; inline-block shim for IE < 8
plugins[] = ie-inline-block.php
View
40 lib/Core.php
@@ -347,7 +347,7 @@ public static function tag ( $file, $options = null, $attributes = array() ) {
}
/**
- * Process host CSS file and return CSS as text wrapped in html <style> tags
+ * Process host CSS file and return CSS as text wrapped in html style tags
*
* @param string $file Absolute or relative path to the host CSS file
* @param mixed $options An array of options or null
@@ -1109,7 +1109,16 @@ public static function extractStrings ( $stream ) {
public static function splitDelimList ( $str, $delim, $fold_in = false, $allow_empty = false ) {
$match_obj = self::matchAllBrackets( $str );
- $match_obj->list = explode( $delim, $match_obj->string );
+
+ // If the delimiter is one character do a simple split
+ // Otherwise do a regex split
+ if ( 1 === strlen( $delim ) ) {
+ $match_obj->list = explode( $delim, $match_obj->string );
+ }
+ else {
+ $match_obj->list = preg_split( '!' . $delim . '!', $match_obj->string );
+ }
+
if ( false === $allow_empty ) {
$match_obj->list = array_filter( $match_obj->list );
}
@@ -1251,4 +1260,29 @@ public static function matchAllBrackets ( $str, $pair = '()', $offset = 0 ) {
return $match_obj;
}
-}
+}
+
+
+#######################
+# Procedural style API
+
+function csscrush_file ( $file, $options = null ) {
+ return CssCrush::file( $file, $options );
+}
+function csscrush_tag ( $file, $options = null, $attributes = array() ) {
+ return CssCrush::tag( $file, $options, $attributes );
+}
+function csscrush_inline ( $file, $options = null, $attributes = array() ) {
+ return CssCrush::inline( $file, $options, $attributes );
+}
+function csscrush_string ( $string, $options = null ) {
+ return CssCrush::string( $string, $options );
+}
+function csscrush_globalvars ( $vars ) {
+ return CssCrush::globalVars( $vars );
+}
+function csscrush_clearcache ( $dir = '' ) {
+ return CssCrush::clearcache( $dir );
+}
+
+
View
14 lib/Function.php
@@ -134,8 +134,10 @@ protected static function parseMathArgs ( $input ) {
return $args;
}
- protected static function parseArgs ( $input, $argCount = null ) {
- $args = CssCrush::splitDelimList( $input, ',', true, true );
+ protected static function parseArgs ( $input, $allowSpaceDelim = false ) {
+ $args = CssCrush::splitDelimList( $input,
+ ( $allowSpaceDelim ? '\s*[,\s]\s*' : ',' ),
+ true, true );
return array_map( 'trim', $args->list );
}
@@ -326,22 +328,22 @@ public static function css_fn__data_uri ( $input ) {
}
public static function css_fn__h_adjust ( $input ) {
- @list( $color, $h ) = self::parseArgs( $input );
+ @list( $color, $h ) = self::parseArgs( $input, true );
return self::colorAdjust( $color, array( $h, 0, 0, 0 ) );
}
public static function css_fn__s_adjust ( $input ) {
- @list( $color, $s ) = self::parseArgs( $input );
+ @list( $color, $s ) = self::parseArgs( $input, true );
return self::colorAdjust( $color, array( 0, $s, 0, 0 ) );
}
public static function css_fn__l_adjust ( $input ) {
- @list( $color, $l ) = self::parseArgs( $input );
+ @list( $color, $l ) = self::parseArgs( $input, true );
return self::colorAdjust( $color, array( 0, 0, $l, 0 ) );
}
public static function css_fn__a_adjust ( $input ) {
- @list( $color, $a ) = self::parseArgs( $input );
+ @list( $color, $a ) = self::parseArgs( $input, true );
return self::colorAdjust( $color, array( 0, 0, 0, $a ) );
}
View
9 misc/initial-values.ini
@@ -55,8 +55,16 @@ caption-side = "top"
clear = "none"
clip = "auto"
color = "inherit"
+columns = "auto"
column-count = "auto"
+column-fill = "balance"
column-gap = "normal"
+column-rule = "medium none currentColor"
+column-rule-color = "currentColor"
+column-rule-style = "none"
+column-rule-width = "none"
+column-span = "1"
+column-width = "auto"
content = "normal"
counter-increment = "none"
counter-reset = "none"
@@ -108,6 +116,7 @@ position = "static"
; May need to alter quotes for different locales (e.g fr)
quotes = "'\201C' '\201D' '\2018' '\2019'"
right = "auto"
+tab-size = "8"
table-layout = "auto"
text-align = "inherit"
text-decoration = "none"

0 comments on commit 4112c02

Please sign in to comment.
Something went wrong with that request. Please try again.