Procedural File: functions.inc.php
Source Location: /functions.inc.php
Page Details:
Various functions
This file contains a few functions which are needed to optimise CSS Code. These functions are not part of the main class since they are not directly related to the parsing process. This file is part of CSSTidy. CSSTidy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. CSSTidy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CSSTidy; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Tags:
compress_numbers [line 110]
string compress_numbers(
string $subvalue, [string $property = NULL])
|
|
Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
Tags:
Parameters
string |
$subvalue |
|
string |
$property |
property needed to check wheter <number>-values are allowed or not |
cut_color [line 37]
string cut_color(
string $color)
|
|
Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
Tags:
Parameters
dissolve_4value_shorthands [line 177]
array dissolve_4value_shorthands(
string $property, string $value)
|
|
Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
Tags:
Parameters
string |
$property |
|
string |
$value |
|
dissolve_short_bg [line 331]
array dissolve_short_bg(
string $str_value)
|
|
Dissolve background property
Tags:
Parameters
explode_ws [line 235]
array explode_ws(
string $sep, string $string)
|
|
Explodes a string as explode() does, however, not if $sep is escaped or within a string.
Tags:
Parameters
string |
$sep |
seperator |
string |
$string |
|
merge_4value_shorthands [line 290]
array merge_4value_shorthands(
array $array)
|
|
Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
Tags:
Parameters
merge_bg [line 417]
array merge_bg(
array $input_css)
|
|
Merges all background properties
Tags:
Parameters
|