Add upstream

This commit is contained in:
root
2019-10-24 00:12:05 +02:00
parent 85d41e4216
commit ac980f592c
3504 changed files with 1049983 additions and 29971 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
<?php
/**
* CSSTidy - CSS Parser and Optimiser
*
* CSS ctype functions
* Defines some functions that can be not defined.
*
* 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
*
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @package csstidy
* @author Nikolay Matsievsky (speed at webo dot name) 2009-2010
* @version 1.0
*/
/* ctype_space Check for whitespace character(s) */
if (!function_exists('ctype_space')) {
function ctype_space($text) {
return!preg_match("/[^\s\r\n\t\f]/", $text);
}
}
/* ctype_alpha Check for alphabetic character(s) */
if (!function_exists('ctype_alpha')) {
function ctype_alpha($text) {
return preg_match("/[a-zA-Z]/", $text);
}
}
?>

View File

@@ -0,0 +1,938 @@
<?php
/**
* CSSTidy - CSS Parser and Optimiser
*
* CSS Optimising Class
* This class optimises CSS data generated by csstidy.
*
* Copyright 2005, 2006, 2007 Florian Schmitz
*
* This file is part of CSSTidy.
*
* CSSTidy is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005-2007
* @author Brett Zamir (brettz9 at yahoo dot com) 2007
* @author Nikolay Matsievsky (speed at webo dot name) 2009-2010
*/
/**
* CSS Optimising Class
*
* This class optimises CSS data generated by csstidy.
*
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005-2006
* @version 1.0
*/
class csstidy_optimise {
/**
* Constructor
* @param array $css contains the class csstidy
* @access private
* @version 1.0
*/
function __construct(&$css) {
$this->parser = & $css;
$this->css = & $css->css;
$this->sub_value = & $css->sub_value;
$this->at = & $css->at;
$this->selector = & $css->selector;
$this->property = & $css->property;
$this->value = & $css->value;
}
function csstidy_optimise(&$css) {
$this->__construct($css);
}
/**
* Optimises $css after parsing
* @access public
* @version 1.0
*/
function postparse() {
if ($this->parser->get_cfg('preserve_css')) {
return;
}
if ($this->parser->get_cfg('merge_selectors') === 2) {
foreach ($this->css as $medium => $value) {
$this->merge_selectors($this->css[$medium]);
}
}
if ($this->parser->get_cfg('discard_invalid_selectors')) {
foreach ($this->css as $medium => $value) {
$this->discard_invalid_selectors($this->css[$medium]);
}
}
if ($this->parser->get_cfg('optimise_shorthands') > 0) {
foreach ($this->css as $medium => $value) {
foreach ($value as $selector => $value1) {
$this->css[$medium][$selector] = csstidy_optimise::merge_4value_shorthands($this->css[$medium][$selector]);
if ($this->parser->get_cfg('optimise_shorthands') < 2) {
continue;
}
$this->css[$medium][$selector] = csstidy_optimise::merge_font($this->css[$medium][$selector]);
if ($this->parser->get_cfg('optimise_shorthands') < 3) {
continue;
}
$this->css[$medium][$selector] = csstidy_optimise::merge_bg($this->css[$medium][$selector]);
if (empty($this->css[$medium][$selector])) {
unset($this->css[$medium][$selector]);
}
}
}
}
}
/**
* Optimises values
* @access public
* @version 1.0
*/
function value() {
$shorthands = & $GLOBALS['csstidy']['shorthands'];
// optimise shorthand properties
if (isset($shorthands[$this->property])) {
$temp = csstidy_optimise::shorthand($this->value); // FIXME - move
if ($temp != $this->value) {
$this->parser->log('Optimised shorthand notation (' . $this->property . '): Changed "' . $this->value . '" to "' . $temp . '"', 'Information');
}
$this->value = $temp;
}
// Remove whitespace at ! important
if ($this->value != $this->compress_important($this->value)) {
$this->parser->log('Optimised !important', 'Information');
}
}
/**
* Optimises shorthands
* @access public
* @version 1.0
*/
function shorthands() {
$shorthands = & $GLOBALS['csstidy']['shorthands'];
if (!$this->parser->get_cfg('optimise_shorthands') || $this->parser->get_cfg('preserve_css')) {
return;
}
if ($this->property === 'font' && $this->parser->get_cfg('optimise_shorthands') > 1) {
$this->css[$this->at][$this->selector]['font']='';
$this->parser->merge_css_blocks($this->at, $this->selector, csstidy_optimise::dissolve_short_font($this->value));
}
if ($this->property === 'background' && $this->parser->get_cfg('optimise_shorthands') > 2) {
$this->css[$this->at][$this->selector]['background']='';
$this->parser->merge_css_blocks($this->at, $this->selector, csstidy_optimise::dissolve_short_bg($this->value));
}
if (isset($shorthands[$this->property])) {
$this->parser->merge_css_blocks($this->at, $this->selector, csstidy_optimise::dissolve_4value_shorthands($this->property, $this->value));
if (is_array($shorthands[$this->property])) {
$this->css[$this->at][$this->selector][$this->property] = '';
}
}
}
/**
* Optimises a sub-value
* @access public
* @version 1.0
*/
function subvalue() {
$replace_colors = & $GLOBALS['csstidy']['replace_colors'];
$this->sub_value = trim($this->sub_value);
if ($this->sub_value == '') { // caution : '0'
return;
}
$important = '';
if (csstidy::is_important($this->sub_value)) {
$important = '!important';
}
$this->sub_value = csstidy::gvw_important($this->sub_value);
// Compress font-weight
if ($this->property === 'font-weight' && $this->parser->get_cfg('compress_font-weight')) {
if ($this->sub_value === 'bold') {
$this->sub_value = '700';
$this->parser->log('Optimised font-weight: Changed "bold" to "700"', 'Information');
} else if ($this->sub_value === 'normal') {
$this->sub_value = '400';
$this->parser->log('Optimised font-weight: Changed "normal" to "400"', 'Information');
}
}
$temp = $this->compress_numbers($this->sub_value);
if (strcasecmp($temp, $this->sub_value) !== 0) {
if (strlen($temp) > strlen($this->sub_value)) {
$this->parser->log('Fixed invalid number: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Warning');
} else {
$this->parser->log('Optimised number: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Information');
}
$this->sub_value = $temp;
}
if ($this->parser->get_cfg('compress_colors')) {
$temp = $this->cut_color($this->sub_value);
if ($temp !== $this->sub_value) {
if (isset($replace_colors[$this->sub_value])) {
$this->parser->log('Fixed invalid color name: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Warning');
} else {
$this->parser->log('Optimised color: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Information');
}
$this->sub_value = $temp;
}
}
$this->sub_value .= $important;
}
/**
* Compresses shorthand values. Example: margin:1px 1px 1px 1px -> margin:1px
* @param string $value
* @access public
* @return string
* @version 1.0
*/
static function shorthand($value) {
$important = '';
if (csstidy::is_important($value)) {
$values = csstidy::gvw_important($value);
$important = '!important';
}
else
$values = $value;
$values = explode(' ', $values);
switch (count($values)) {
case 4:
if ($values[0] == $values[1] && $values[0] == $values[2] && $values[0] == $values[3]) {
return $values[0] . $important;
} elseif ($values[1] == $values[3] && $values[0] == $values[2]) {
return $values[0] . ' ' . $values[1] . $important;
} elseif ($values[1] == $values[3]) {
return $values[0] . ' ' . $values[1] . ' ' . $values[2] . $important;
}
break;
case 3:
if ($values[0] == $values[1] && $values[0] == $values[2]) {
return $values[0] . $important;
} elseif ($values[0] == $values[2]) {
return $values[0] . ' ' . $values[1] . $important;
}
break;
case 2:
if ($values[0] == $values[1]) {
return $values[0] . $important;
}
break;
}
return $value;
}
/**
* Removes unnecessary whitespace in ! important
* @param string $string
* @return string
* @access public
* @version 1.1
*/
function compress_important(&$string) {
if (csstidy::is_important($string)) {
$string = csstidy::gvw_important($string) . ' !important'; }
return $string;
}
/**
* Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
* @param string $color
* @return string
* @version 1.1
*/
function cut_color($color) {
$replace_colors = & $GLOBALS['csstidy']['replace_colors'];
// rgb(0,0,0) -> #000000 (or #000 in this case later)
if (strtolower(substr($color, 0, 4)) === 'rgb(') {
$color_tmp = substr($color, 4, strlen($color) - 5);
$color_tmp = explode(',', $color_tmp);
for ($i = 0; $i < count($color_tmp); $i++) {
$color_tmp[$i] = trim($color_tmp[$i]);
if (substr($color_tmp[$i], -1) === '%') {
$color_tmp[$i] = round((255 * $color_tmp[$i]) / 100);
}
if ($color_tmp[$i] > 255)
$color_tmp[$i] = 255;
}
$color = '#';
for ($i = 0; $i < 3; $i++) {
if ($color_tmp[$i] < 16) {
$color .= '0' . dechex($color_tmp[$i]);
} else {
$color .= dechex($color_tmp[$i]);
}
}
}
// Fix bad color names
if (isset($replace_colors[strtolower($color)])) {
$color = $replace_colors[strtolower($color)];
}
// #aabbcc -> #abc
if (strlen($color) == 7) {
$color_temp = strtolower($color);
if ($color_temp{0} === '#' && $color_temp{1} == $color_temp{2} && $color_temp{3} == $color_temp{4} && $color_temp{5} == $color_temp{6}) {
$color = '#' . $color{1} . $color{3} . $color{5};
}
}
switch (strtolower($color)) {
/* color name -> hex code */
case 'black': return '#000';
case 'fuchsia': return '#f0f';
case 'white': return '#fff';
case 'yellow': return '#ff0';
/* hex code -> color name */
case '#800000': return 'maroon';
case '#ffa500': return 'orange';
case '#808000': return 'olive';
case '#800080': return 'purple';
case '#008000': return 'green';
case '#000080': return 'navy';
case '#008080': return 'teal';
case '#c0c0c0': return 'silver';
case '#808080': return 'gray';
case '#f00': return 'red';
}
return $color;
}
/**
* Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
* @param string $subvalue
* @return string
* @version 1.2
*/
function compress_numbers($subvalue) {
$unit_values = & $GLOBALS['csstidy']['unit_values'];
$color_values = & $GLOBALS['csstidy']['color_values'];
// for font:1em/1em sans-serif...;
if ($this->property === 'font') {
$temp = explode('/', $subvalue);
} else {
$temp = array($subvalue);
}
for ($l = 0; $l < count($temp); $l++) {
// if we are not dealing with a number at this point, do not optimise anything
$number = $this->AnalyseCssNumber($temp[$l]);
if ($number === false) {
return $subvalue;
}
// Fix bad colors
if (in_array($this->property, $color_values)) {
if (strlen($temp[$l]) == 3 || strlen($temp[$l]) == 6) {
$temp[$l] = '#' . $temp[$l];
}
else {
$temp[$l] = "0";
}
continue;
}
if (abs($number[0]) > 0) {
if ($number[1] == '' && in_array($this->property, $unit_values, true)) {
$number[1] = 'px';
}
} else {
$number[1] = '';
}
$temp[$l] = $number[0] . $number[1];
}
return ((count($temp) > 1) ? $temp[0] . '/' . $temp[1] : $temp[0]);
}
/**
* Checks if a given string is a CSS valid number. If it is,
* an array containing the value and unit is returned
* @param string $string
* @return array ('unit' if unit is found or '' if no unit exists, number value) or false if no number
*/
function AnalyseCssNumber($string) {
// most simple checks first
if (strlen($string) == 0 || ctype_alpha($string{0})) {
return false;
}
$units = & $GLOBALS['csstidy']['units'];
$return = array(0, '');
$return[0] = floatval($string);
if (abs($return[0]) > 0 && abs($return[0]) < 1) {
if ($return[0] < 0) {
$return[0] = '-' . ltrim(substr($return[0], 1), '0');
} else {
$return[0] = ltrim($return[0], '0');
}
}
// Look for unit and split from value if exists
foreach ($units as $unit) {
$expectUnitAt = strlen($string) - strlen($unit);
if (!($unitInString = stristr($string, $unit))) { // mb_strpos() fails with "false"
continue;
}
$actualPosition = strpos($string, $unitInString);
if ($expectUnitAt === $actualPosition) {
$return[1] = $unit;
$string = substr($string, 0, - strlen($unit));
break;
}
}
if (!is_numeric($string)) {
return false;
}
return $return;
}
/**
* Merges selectors with same properties. Example: a{color:red} b{color:red} -> a,b{color:red}
* Very basic and has at least one bug. Hopefully there is a replacement soon.
* @param array $array
* @return array
* @access public
* @version 1.2
*/
function merge_selectors(&$array) {
$css = $array;
foreach ($css as $key => $value) {
if (!isset($css[$key])) {
continue;
}
$newsel = '';
// Check if properties also exist in another selector
$keys = array();
// PHP bug (?) without $css = $array; here
foreach ($css as $selector => $vali) {
if ($selector == $key) {
continue;
}
if ($css[$key] === $vali) {
$keys[] = $selector;
}
}
if (!empty($keys)) {
$newsel = $key;
unset($css[$key]);
foreach ($keys as $selector) {
unset($css[$selector]);
$newsel .= ',' . $selector;
}
$css[$newsel] = $value;
}
}
$array = $css;
}
/**
* Removes invalid selectors and their corresponding rule-sets as
* defined by 4.1.7 in REC-CSS2. This is a very rudimentary check
* and should be replaced by a full-blown parsing algorithm or
* regular expression
* @version 1.4
*/
function discard_invalid_selectors(&$array) {
$invalid = array('+' => true, '~' => true, ',' => true, '>' => true);
foreach ($array as $selector => $decls) {
$ok = true;
$selectors = array_map('trim', explode(',', $selector));
foreach ($selectors as $s) {
$simple_selectors = preg_split('/\s*[+>~\s]\s*/', $s);
foreach ($simple_selectors as $ss) {
if ($ss === '')
$ok = false;
// could also check $ss for internal structure,
// but that probably would be too slow
}
}
if (!$ok)
unset($array[$selector]);
}
}
/**
* Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
* @param string $property
* @param string $value
* @return array
* @version 1.0
* @see merge_4value_shorthands()
*/
static function dissolve_4value_shorthands($property, $value) {
$shorthands = & $GLOBALS['csstidy']['shorthands'];
if (!is_array($shorthands[$property])) {
$return[$property] = $value;
return $return;
}
$important = '';
if (csstidy::is_important($value)) {
$value = csstidy::gvw_important($value);
$important = '!important';
}
$values = explode(' ', $value);
$return = array();
if (count($values) == 4) {
for ($i = 0; $i < 4; $i++) {
$return[$shorthands[$property][$i]] = $values[$i] . $important;
}
} elseif (count($values) == 3) {
$return[$shorthands[$property][0]] = $values[0] . $important;
$return[$shorthands[$property][1]] = $values[1] . $important;
$return[$shorthands[$property][3]] = $values[1] . $important;
$return[$shorthands[$property][2]] = $values[2] . $important;
} elseif (count($values) == 2) {
for ($i = 0; $i < 4; $i++) {
$return[$shorthands[$property][$i]] = (($i % 2 != 0)) ? $values[1] . $important : $values[0] . $important;
}
} else {
for ($i = 0; $i < 4; $i++) {
$return[$shorthands[$property][$i]] = $values[0] . $important;
}
}
return $return;
}
/**
* Explodes a string as explode() does, however, not if $sep is escaped or within a string.
* @param string $sep seperator
* @param string $string
* @return array
* @version 1.0
*/
static function explode_ws($sep, $string) {
$status = 'st';
$to = '';
$output = array();
$num = 0;
for ($i = 0, $len = strlen($string); $i < $len; $i++) {
switch ($status) {
case 'st':
if ($string{$i} == $sep && !csstidy::escaped($string, $i)) {
++$num;
} elseif ($string{$i} === '"' || $string{$i} === '\'' || $string{$i} === '(' && !csstidy::escaped($string, $i)) {
$status = 'str';
$to = ($string{$i} === '(') ? ')' : $string{$i};
(isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
} else {
(isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
}
break;
case 'str':
if ($string{$i} == $to && !csstidy::escaped($string, $i)) {
$status = 'st';
}
(isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
break;
}
}
if (isset($output[0])) {
return $output;
} else {
return array($output);
}
}
/**
* Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
* @param array $array
* @return array
* @version 1.2
* @see dissolve_4value_shorthands()
*/
static function merge_4value_shorthands($array) {
$return = $array;
$shorthands = & $GLOBALS['csstidy']['shorthands'];
foreach ($shorthands as $key => $value) {
if (isset($array[$value[0]]) && isset($array[$value[1]])
&& isset($array[$value[2]]) && isset($array[$value[3]]) && $value !== 0) {
$return[$key] = '';
$important = '';
for ($i = 0; $i < 4; $i++) {
$val = $array[$value[$i]];
if (csstidy::is_important($val)) {
$important = '!important';
$return[$key] .= csstidy::gvw_important($val) . ' ';
} else {
$return[$key] .= $val . ' ';
}
unset($return[$value[$i]]);
}
$return[$key] = csstidy_optimise::shorthand(trim($return[$key] . $important));
}
}
return $return;
}
/**
* Dissolve background property
* @param string $str_value
* @return array
* @version 1.0
* @see merge_bg()
* @todo full CSS 3 compliance
*/
static function dissolve_short_bg($str_value) {
// don't try to explose background gradient !
if (stripos($str_value, "gradient(")!==FALSE)
return array('background'=>$str_value);
$background_prop_default = & $GLOBALS['csstidy']['background_prop_default'];
$repeat = array('repeat', 'repeat-x', 'repeat-y', 'no-repeat', 'space');
$attachment = array('scroll', 'fixed', 'local');
$clip = array('border', 'padding');
$origin = array('border', 'padding', 'content');
$pos = array('top', 'center', 'bottom', 'left', 'right');
$important = '';
$return = array('background-image' => null, 'background-size' => null, 'background-repeat' => null, 'background-position' => null, 'background-attachment' => null, 'background-clip' => null, 'background-origin' => null, 'background-color' => null);
if (csstidy::is_important($str_value)) {
$important = ' !important';
$str_value = csstidy::gvw_important($str_value);
}
$str_value = csstidy_optimise::explode_ws(',', $str_value);
for ($i = 0; $i < count($str_value); $i++) {
$have['clip'] = false;
$have['pos'] = false;
$have['color'] = false;
$have['bg'] = false;
if (is_array($str_value[$i])) {
$str_value[$i] = $str_value[$i][0];
}
$str_value[$i] = csstidy_optimise::explode_ws(' ', trim($str_value[$i]));
for ($j = 0; $j < count($str_value[$i]); $j++) {
if ($have['bg'] === false && (substr($str_value[$i][$j], 0, 4) === 'url(' || $str_value[$i][$j] === 'none')) {
$return['background-image'] .= $str_value[$i][$j] . ',';
$have['bg'] = true;
} elseif (in_array($str_value[$i][$j], $repeat, true)) {
$return['background-repeat'] .= $str_value[$i][$j] . ',';
} elseif (in_array($str_value[$i][$j], $attachment, true)) {
$return['background-attachment'] .= $str_value[$i][$j] . ',';
} elseif (in_array($str_value[$i][$j], $clip, true) && !$have['clip']) {
$return['background-clip'] .= $str_value[$i][$j] . ',';
$have['clip'] = true;
} elseif (in_array($str_value[$i][$j], $origin, true)) {
$return['background-origin'] .= $str_value[$i][$j] . ',';
} elseif ($str_value[$i][$j]{0} === '(') {
$return['background-size'] .= substr($str_value[$i][$j], 1, -1) . ',';
} elseif (in_array($str_value[$i][$j], $pos, true) || is_numeric($str_value[$i][$j]{0}) || $str_value[$i][$j]{0} === null || $str_value[$i][$j]{0} === '-' || $str_value[$i][$j]{0} === '.') {
$return['background-position'] .= $str_value[$i][$j];
if (!$have['pos'])
$return['background-position'] .= ' '; else
$return['background-position'].= ',';
$have['pos'] = true;
}
elseif (!$have['color']) {
$return['background-color'] .= $str_value[$i][$j] . ',';
$have['color'] = true;
}
}
}
foreach ($background_prop_default as $bg_prop => $default_value) {
if ($return[$bg_prop] !== null) {
$return[$bg_prop] = substr($return[$bg_prop], 0, -1) . $important;
}
else
$return[$bg_prop] = $default_value . $important;
}
return $return;
}
/**
* Merges all background properties
* @param array $input_css
* @return array
* @version 1.0
* @see dissolve_short_bg()
* @todo full CSS 3 compliance
*/
static function merge_bg($input_css) {
$background_prop_default = & $GLOBALS['csstidy']['background_prop_default'];
// Max number of background images. CSS3 not yet fully implemented
$number_of_values = @max(count(csstidy_optimise::explode_ws(',', $input_css['background-image'])), count(csstidy_optimise::explode_ws(',', $input_css['background-color'])), 1);
// Array with background images to check if BG image exists
$bg_img_array = @csstidy_optimise::explode_ws(',', csstidy::gvw_important($input_css['background-image']));
$new_bg_value = '';
$important = '';
// if background properties is here and not empty, don't try anything
if (isset($input_css['background']) AND $input_css['background'])
return $input_css;
for ($i = 0; $i < $number_of_values; $i++) {
foreach ($background_prop_default as $bg_property => $default_value) {
// Skip if property does not exist
if (!isset($input_css[$bg_property])) {
continue;
}
$cur_value = $input_css[$bg_property];
// skip all optimisation if gradient() somewhere
if (stripos($cur_value, "gradient(")!==FALSE)
return $input_css;
// Skip some properties if there is no background image
if ((!isset($bg_img_array[$i]) || $bg_img_array[$i] === 'none')
&& ($bg_property === 'background-size' || $bg_property === 'background-position'
|| $bg_property === 'background-attachment' || $bg_property === 'background-repeat')) {
continue;
}
// Remove !important
if (csstidy::is_important($cur_value)) {
$important = ' !important';
$cur_value = csstidy::gvw_important($cur_value);
}
// Do not add default values
if ($cur_value === $default_value) {
continue;
}
$temp = csstidy_optimise::explode_ws(',', $cur_value);
if (isset($temp[$i])) {
if ($bg_property === 'background-size') {
$new_bg_value .= '(' . $temp[$i] . ') ';
} else {
$new_bg_value .= $temp[$i] . ' ';
}
}
}
$new_bg_value = trim($new_bg_value);
if ($i != $number_of_values - 1)
$new_bg_value .= ',';
}
// Delete all background-properties
foreach ($background_prop_default as $bg_property => $default_value) {
unset($input_css[$bg_property]);
}
// Add new background property
if ($new_bg_value !== '')
$input_css['background'] = $new_bg_value . $important;
elseif(isset ($input_css['background']))
$input_css['background'] = 'none';
return $input_css;
}
/**
* Dissolve font property
* @param string $str_value
* @return array
* @version 1.3
* @see merge_font()
*/
static function dissolve_short_font($str_value) {
$font_prop_default = & $GLOBALS['csstidy']['font_prop_default'];
$font_weight = array('normal', 'bold', 'bolder', 'lighter', 100, 200, 300, 400, 500, 600, 700, 800, 900);
$font_variant = array('normal', 'small-caps');
$font_style = array('normal', 'italic', 'oblique');
$important = '';
$return = array('font-style' => null, 'font-variant' => null, 'font-weight' => null, 'font-size' => null, 'line-height' => null, 'font-family' => null);
if (csstidy::is_important($str_value)) {
$important = '!important';
$str_value = csstidy::gvw_important($str_value);
}
$have['style'] = false;
$have['variant'] = false;
$have['weight'] = false;
$have['size'] = false;
// Detects if font-family consists of several words w/o quotes
$multiwords = false;
// Workaround with multiple font-family
$str_value = csstidy_optimise::explode_ws(',', trim($str_value));
$str_value[0] = csstidy_optimise::explode_ws(' ', trim($str_value[0]));
for ($j = 0; $j < count($str_value[0]); $j++) {
if ($have['weight'] === false && in_array($str_value[0][$j], $font_weight)) {
$return['font-weight'] = $str_value[0][$j];
$have['weight'] = true;
} elseif ($have['variant'] === false && in_array($str_value[0][$j], $font_variant)) {
$return['font-variant'] = $str_value[0][$j];
$have['variant'] = true;
} elseif ($have['style'] === false && in_array($str_value[0][$j], $font_style)) {
$return['font-style'] = $str_value[0][$j];
$have['style'] = true;
} elseif ($have['size'] === false && (is_numeric($str_value[0][$j]{0}) || $str_value[0][$j]{0} === null || $str_value[0][$j]{0} === '.')) {
$size = csstidy_optimise::explode_ws('/', trim($str_value[0][$j]));
$return['font-size'] = $size[0];
if (isset($size[1])) {
$return['line-height'] = $size[1];
} else {
$return['line-height'] = ''; // don't add 'normal' !
}
$have['size'] = true;
} else {
if (isset($return['font-family'])) {
$return['font-family'] .= ' ' . $str_value[0][$j];
$multiwords = true;
} else {
$return['font-family'] = $str_value[0][$j];
}
}
}
// add quotes if we have several qords in font-family
if ($multiwords !== false) {
$return['font-family'] = '"' . $return['font-family'] . '"';
}
$i = 1;
while (isset($str_value[$i])) {
$return['font-family'] .= ',' . trim($str_value[$i]);
$i++;
}
// Fix for 100 and more font-size
if ($have['size'] === false && isset($return['font-weight']) &&
is_numeric($return['font-weight']{0})) {
$return['font-size'] = $return['font-weight'];
unset($return['font-weight']);
}
foreach ($font_prop_default as $font_prop => $default_value) {
if ($return[$font_prop] !== null) {
$return[$font_prop] = $return[$font_prop] . $important;
}
else
$return[$font_prop] = $default_value . $important;
}
return $return;
}
/**
* Merges all fonts properties
* @param array $input_css
* @return array
* @version 1.3
* @see dissolve_short_font()
*/
static function merge_font($input_css) {
$font_prop_default = & $GLOBALS['csstidy']['font_prop_default'];
$new_font_value = '';
$important = '';
// Skip if not font-family and font-size set
if (isset($input_css['font-family']) && isset($input_css['font-size'])) {
// fix several words in font-family - add quotes
if (isset($input_css['font-family'])) {
$families = explode(",", $input_css['font-family']);
$result_families = array();
foreach ($families as $family) {
$family = trim($family);
$len = strlen($family);
if (strpos($family, " ") &&
!(($family{0} == '"' && $family{$len - 1} == '"') ||
($family{0} == "'" && $family{$len - 1} == "'"))) {
$family = '"' . $family . '"';
}
$result_families[] = $family;
}
$input_css['font-family'] = implode(",", $result_families);
}
foreach ($font_prop_default as $font_property => $default_value) {
// Skip if property does not exist
if (!isset($input_css[$font_property])) {
continue;
}
$cur_value = $input_css[$font_property];
// Skip if default value is used
if ($cur_value === $default_value) {
continue;
}
// Remove !important
if (csstidy::is_important($cur_value)) {
$important = '!important';
$cur_value = csstidy::gvw_important($cur_value);
}
$new_font_value .= $cur_value;
// Add delimiter
$new_font_value .= ( $font_property === 'font-size' &&
isset($input_css['line-height'])) ? '/' : ' ';
}
$new_font_value = trim($new_font_value);
// Delete all font-properties
foreach ($font_prop_default as $font_property => $default_value) {
if ($font_property!=='font' OR !$new_font_value)
unset($input_css[$font_property]);
}
// Add new font property
if ($new_font_value !== '') {
$input_css['font'] = $new_font_value . $important;
}
}
return $input_css;
}
}

View File

@@ -0,0 +1,410 @@
<?php
/**
* CSSTidy - CSS Parser and Optimiser
*
* CSS Printing class
* This class prints CSS data generated by csstidy.
*
* Copyright 2005, 2006, 2007 Florian Schmitz
*
* This file is part of CSSTidy.
*
* CSSTidy is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005-2007
* @author Brett Zamir (brettz9 at yahoo dot com) 2007
* @author Cedric Morin (cedric at yterium dot com) 2010
*/
/**
* CSS Printing class
*
* This class prints CSS data generated by csstidy.
*
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005-2006
* @version 1.0.1
*/
class csstidy_print {
/**
* Saves the input CSS string
* @var string
* @access private
*/
public $input_css = '';
/**
* Saves the formatted CSS string
* @var string
* @access public
*/
public $output_css = '';
/**
* Saves the formatted CSS string (plain text)
* @var string
* @access public
*/
public $output_css_plain = '';
/**
* Constructor
* @param array $css contains the class csstidy
* @access private
* @version 1.0
*/
function __construct(&$css) {
$this->parser = & $css;
$this->css = & $css->css;
$this->template = & $css->template;
$this->tokens = & $css->tokens;
$this->charset = & $css->charset;
$this->import = & $css->import;
$this->namespace = & $css->namespace;
}
function csstidy_print(&$css) {
$this->__construct($css);
}
/**
* Resets output_css and output_css_plain (new css code)
* @access private
* @version 1.0
*/
function _reset() {
$this->output_css = '';
$this->output_css_plain = '';
}
/**
* Returns the CSS code as plain text
* @param string $default_media default @media to add to selectors without any @media
* @return string
* @access public
* @version 1.0
*/
function plain($default_media='') {
$this->_print(true, $default_media);
return $this->output_css_plain;
}
/**
* Returns the formatted CSS code
* @param string $default_media default @media to add to selectors without any @media
* @return string
* @access public
* @version 1.0
*/
function formatted($default_media='') {
$this->_print(false, $default_media);
return $this->output_css;
}
/**
* Returns the formatted CSS code to make a complete webpage
* @param string $doctype shorthand for the document type
* @param bool $externalcss indicates whether styles to be attached internally or as an external stylesheet
* @param string $title title to be added in the head of the document
* @param string $lang two-letter language code to be added to the output
* @return string
* @access public
* @version 1.4
*/
function formatted_page($doctype='xhtml1.1', $externalcss=true, $title='', $lang='en') {
switch ($doctype) {
case 'xhtml1.0strict':
$doctype_output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
break;
case 'xhtml1.1':
default:
$doctype_output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';
break;
}
$output = $cssparsed = '';
$this->output_css_plain = & $output;
$output .= $doctype_output . "\n" . '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $lang . '"';
$output .= ( $doctype === 'xhtml1.1') ? '>' : ' lang="' . $lang . '">';
$output .= "\n<head>\n <title>$title</title>";
if ($externalcss) {
$output .= "\n <style type=\"text/css\">\n";
$cssparsed = file_get_contents('cssparsed.css');
$output .= $cssparsed; // Adds an invisible BOM or something, but not in css_optimised.php
$output .= "\n</style>";
} else {
$output .= "\n" . ' <link rel="stylesheet" type="text/css" href="cssparsed.css" />';
// }
}
$output .= "\n</head>\n<body><code id=\"copytext\">";
$output .= $this->formatted();
$output .= '</code>' . "\n" . '</body></html>';
return $this->output_css_plain;
}
/**
* Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
* @param bool $plain plain text or not
* @param string $default_media default @media to add to selectors without any @media
* @access private
* @version 2.0
*/
function _print($plain = false, $default_media='') {
if ($this->output_css && $this->output_css_plain) {
return;
}
$output = '';
if (!$this->parser->get_cfg('preserve_css')) {
$this->_convert_raw_css($default_media);
}
$template = & $this->template;
if ($plain) {
$template = array_map('strip_tags', $template);
}
if ($this->parser->get_cfg('timestamp')) {
array_unshift($this->tokens, array(COMMENT, ' CSSTidy ' . $this->parser->version . ': ' . date('r') . ' '));
}
if (!empty($this->charset)) {
$output .= $template[0] . '@charset ' . $template[5] . $this->charset . $template[6];
}
if (!empty($this->import)) {
for ($i = 0, $size = count($this->import); $i < $size; $i++) {
$import_components = explode(' ', $this->import[$i]);
if (substr($import_components[0], 0, 4) === 'url(' && substr($import_components[0], -1, 1) === ')') {
$import_components[0] = '\'' . trim(substr($import_components[0], 4, -1), "'\"") . '\'';
$this->import[$i] = implode(' ', $import_components);
$this->parser->log('Optimised @import : Removed "url("', 'Information');
}
$output .= $template[0] . '@import ' . $template[5] . $this->import[$i] . $template[6];
}
}
if (!empty($this->namespace)) {
if (substr($this->namespace, 0, 4) === 'url(' && substr($this->namespace, -1, 1) === ')') {
$this->namespace = '\'' . substr($this->namespace, 4, -1) . '\'';
$this->parser->log('Optimised @namespace : Removed "url("', 'Information');
}
$output .= $template[0] . '@namespace ' . $template[5] . $this->namespace . $template[6];
}
$output .= $template[13];
$in_at_out = '';
$out = & $output;
foreach ($this->tokens as $key => $token) {
switch ($token[0]) {
case AT_START:
$out .= $template[0] . $this->_htmlsp($token[1], $plain) . $template[1];
$out = & $in_at_out;
break;
case SEL_START:
if ($this->parser->get_cfg('lowercase_s'))
$token[1] = strtolower($token[1]);
$out .= ( $token[1]{0} !== '@') ? $template[2] . $this->_htmlsp($token[1], $plain) : $template[0] . $this->_htmlsp($token[1], $plain);
$out .= $template[3];
break;
case PROPERTY:
if ($this->parser->get_cfg('case_properties') === 2) {
$token[1] = strtoupper($token[1]);
} elseif ($this->parser->get_cfg('case_properties') === 1) {
$token[1] = strtolower($token[1]);
}
$out .= $template[4] . $this->_htmlsp($token[1], $plain) . ':' . $template[5];
break;
case VALUE:
$out .= $this->_htmlsp($token[1], $plain);
if ($this->_seeknocomment($key, 1) == SEL_END && $this->parser->get_cfg('remove_last_;')) {
$out .= str_replace(';', '', $template[6]);
} else {
$out .= $template[6];
}
break;
case SEL_END:
$out .= $template[7];
if ($this->_seeknocomment($key, 1) != AT_END)
$out .= $template[8];
break;
case AT_END:
$out = & $output;
$out .= $template[10] . str_replace("\n", "\n" . $template[10], $in_at_out);
$in_at_out = '';
$out .= $template[9];
break;
case COMMENT:
$out .= $template[11] . '/*' . $this->_htmlsp($token[1], $plain) . '*/' . $template[12];
break;
}
}
$output = trim($output);
if (!$plain) {
$this->output_css = $output;
$this->_print(true);
} else {
// If using spaces in the template, don't want these to appear in the plain output
$this->output_css_plain = str_replace('&#160;', '', $output);
}
}
/**
* Gets the next token type which is $move away from $key, excluding comments
* @param integer $key current position
* @param integer $move move this far
* @return mixed a token type
* @access private
* @version 1.0
*/
function _seeknocomment($key, $move) {
$go = ($move > 0) ? 1 : -1;
for ($i = $key + 1; abs($key - $i) - 1 < abs($move); $i += $go) {
if (!isset($this->tokens[$i])) {
return;
}
if ($this->tokens[$i][0] == COMMENT) {
$move += 1;
continue;
}
return $this->tokens[$i][0];
}
}
/**
* Converts $this->css array to a raw array ($this->tokens)
* @param string $default_media default @media to add to selectors without any @media
* @access private
* @version 1.0
*/
function _convert_raw_css($default_media='') {
$this->tokens = array();
foreach ($this->css as $medium => $val) {
if ($this->parser->get_cfg('sort_selectors'))
ksort($val);
if (intval($medium) < DEFAULT_AT) {
$this->parser->_add_token(AT_START, $medium, true);
}
elseif ($default_media) {
$this->parser->_add_token(AT_START, $default_media, true);
}
foreach ($val as $selector => $vali) {
if ($this->parser->get_cfg('sort_properties'))
ksort($vali);
$this->parser->_add_token(SEL_START, $selector, true);
foreach ($vali as $property => $valj) {
$this->parser->_add_token(PROPERTY, $property, true);
$this->parser->_add_token(VALUE, $valj, true);
}
$this->parser->_add_token(SEL_END, $selector, true);
}
if (intval($medium) < DEFAULT_AT) {
$this->parser->_add_token(AT_END, $medium, true);
}
elseif ($default_media) {
$this->parser->_add_token(AT_END, $default_media, true);
}
}
}
/**
* Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
* @param string $string
* @param bool $plain
* @return string
* @see csstidy_print::_print()
* @access private
* @version 1.0
*/
function _htmlsp($string, $plain) {
if (!$plain) {
return htmlspecialchars($string, ENT_QUOTES, 'utf-8');
}
return $string;
}
/**
* Get compression ratio
* @access public
* @return float
* @version 1.2
*/
function get_ratio() {
if (!$this->output_css_plain) {
$this->formatted();
}
return round((strlen($this->input_css) - strlen($this->output_css_plain)) / strlen($this->input_css), 3) * 100;
}
/**
* Get difference between the old and new code in bytes and prints the code if necessary.
* @access public
* @return string
* @version 1.1
*/
function get_diff() {
if (!$this->output_css_plain) {
$this->formatted();
}
$diff = strlen($this->output_css_plain) - strlen($this->input_css);
if ($diff > 0) {
return '+' . $diff;
} elseif ($diff == 0) {
return '+-' . $diff;
}
return $diff;
}
/**
* Get the size of either input or output CSS in KB
* @param string $loc default is "output"
* @access public
* @return integer
* @version 1.0
*/
function size($loc = 'output') {
if ($loc === 'output' && !$this->output_css) {
$this->formatted();
}
if ($loc === 'input') {
return (strlen($this->input_css) / 1000);
} else {
return (strlen($this->output_css_plain) / 1000);
}
}
}

View File

@@ -0,0 +1,119 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
@import url("./cssparsed.css");
html, body {
font:0.8em Verdana,Helvetica,sans-serif;
background:#F8F8F6;
}
code {
font-size:1.2em;
}
div#rightcol {
padding-right:32em;
}
fieldset {
display:block;
margin:0.5em 0;
padding:1em;
border:solid #7284AB 2px;
}
fieldset.code_output {
display:inline;
}
h1 {
font-size:2em;
}
small {
font-size:0.7em;
}
fieldset#field_input {
float:right;
margin:0 0 1em 0.5em;
}
fieldset#options,fieldset#code_layout {
width:31em;
}
input#submit {
clear:both;
display:block;
margin:1em;
}
select {
margin:2px 0 0;
}
label.block {
display:block;
}
legend {
background:#c4E1C3;
padding:2px 4px;
border:dashed 1px;
}
textarea#css_text {
width:27em;
height:370px;
display:block;
margin-left:1em;
}
.help {
cursor:help;
}
p.important {
border:solid 1px red;
font-weight:bold;
padding:1em;
background:white;
}
p {
margin:1em 0;
}
dl {
padding-right:0.5em;
}
dt {
font-weight:bold;
margin:0;
float:right;
clear:both;
height:1.5em;
}
dd {
margin:0 4em 0 0;
height:1.5em;
}
fieldset#messages {
background:white;
padding:0 1em 0 0;
}
fieldset#messages div {
height:10em;
overflow:auto;
}
dd.Warning {
color:orange;
}
dd.Information {
color:green;
}

View File

@@ -0,0 +1 @@
code#copytext{white-space:pre;font-family:Verdana}.at{color:#00008b}.format{color:gray}.property{color:green}.selector{color:#00f}.value{color:red;left:500px}.comment{color:orange}body,html{font:.8em Verdana,Helvetica,sans-serif;background:#f8f8f6}code{font-size:1.2em}div#rightcol{padding-right:32em}fieldset{display:block;margin:.5em 0;padding:1em;border:solid #7284ab 2px}fieldset.code_output{display:inline}h1{font-size:2em}small{font-size:.7em}fieldset#field_input{float:right;margin:0 0 1em .5em}fieldset#code_layout,fieldset#options{width:31em}input#submit{clear:both;display:block;margin:1em}select{margin:2px 0 0}label.block{display:block}legend{background:#c4e1c3;padding:2px 4px;border:dashed 1px}textarea#css_text{width:27em;height:370px;display:block;margin-left:1em}.help{cursor:help}p.important{border:solid 1px red;font-weight:700;padding:1em;background:#fff}p{margin:1em 0}dl{padding-right:.5em}dt{font-weight:700;margin:0;float:right;clear:both;height:1.5em}dd{margin:0 4em 0 0;height:1.5em}fieldset#messages{background:#fff;padding:0 1em 0 0}fieldset#messages div{height:10em;overflow:auto}dd.Warning{color:orange}dd.Information{color:green}

View File

@@ -0,0 +1,118 @@
@import url("./cssparsed.css");
html, body {
font:0.8em Verdana,Helvetica,sans-serif;
background:#F8F8F6;
}
code {
font-size:1.2em;
}
div#rightcol {
padding-left:32em;
}
fieldset {
display:block;
margin:0.5em 0;
padding:1em;
border:solid #7284AB 2px;
}
fieldset.code_output {
display:inline;
}
h1 {
font-size:2em;
}
small {
font-size:0.7em;
}
fieldset#field_input {
float:left;
margin:0 0.5em 1em 0;
}
fieldset#options,fieldset#code_layout {
width:31em;
}
input#submit {
clear:both;
display:block;
margin:1em;
}
select {
margin:2px 0 0;
}
label.block {
display:block;
}
legend {
background:#c4E1C3;
padding:2px 4px;
border:dashed 1px;
}
textarea#css_text {
width:27em;
height:370px;
display:block;
margin-right:1em;
}
.help {
cursor:help;
}
p.important {
border:solid 1px red;
font-weight:bold;
padding:1em;
background:white;
}
p {
margin:1em 0;
}
dl {
padding-left:0.5em;
}
dt {
font-weight:bold;
margin:0;
float:left;
clear:both;
height:1.5em;
}
dd {
margin:0 0 0 4em;
height:1.5em;
}
fieldset#messages {
background:white;
padding:0 0 0 1em;
}
fieldset#messages div {
height:10em;
overflow:auto;
}
dd.Warning {
color:orange;
}
dd.Information {
color:green;
}

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
code#copytext{white-space:pre;font-family:Verdana}.at{color:#00008b}.format{color:gray}.property{color:green}.selector{color:#00f}.value{color:red;left:500px}.comment{color:orange}body,html{font:.8em Verdana,Helvetica,sans-serif;background:#f8f8f6}code{font-size:1.2em}div#rightcol{padding-left:32em}fieldset{display:block;margin:.5em 0;padding:1em;border:solid #7284ab 2px}fieldset.code_output{display:inline}h1{font-size:2em}small{font-size:.7em}fieldset#field_input{float:left;margin:0 .5em 1em 0}fieldset#code_layout,fieldset#options{width:31em}input#submit{clear:both;display:block;margin:1em}select{margin:2px 0 0}label.block{display:block}legend{background:#c4e1c3;padding:2px 4px;border:dashed 1px}textarea#css_text{width:27em;height:370px;display:block;margin-right:1em}.help{cursor:help}p.important{border:solid 1px red;font-weight:700;padding:1em;background:#fff}p{margin:1em 0}dl{padding-left:.5em}dt{font-weight:700;margin:0;float:left;clear:both;height:1.5em}dd{margin:0 0 0 4em;height:1.5em}fieldset#messages{background:#fff;padding:0 0 0 1em}fieldset#messages div{height:10em;overflow:auto}dd.Warning{color:orange}dd.Information{color:green}

View File

@@ -0,0 +1,30 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
code#copytext {
white-space: pre;
font-family: Verdana;
}
.at {
color:darkblue;
}
.format {
color:gray;
}
.property {
color:green;
}
.selector {
color:blue;
}
.value {
color:red;
right: 500px;
}
.comment {
color:orange;
}

View File

@@ -0,0 +1 @@
code#copytext{white-space:pre;font-family:Verdana}.at{color:#00008b}.format{color:gray}.property{color:green}.selector{color:#00f}.value{color:red;right:500px}.comment{color:orange}

View File

@@ -0,0 +1,29 @@
code#copytext {
white-space: pre;
font-family: Verdana;
}
.at {
color:darkblue;
}
.format {
color:gray;
}
.property {
color:green;
}
.selector {
color:blue;
}
.value {
color:red;
left: 500px;
}
.comment {
color:orange;
}

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
code#copytext{white-space:pre;font-family:Verdana}.at{color:#00008b}.format{color:gray}.property{color:green}.selector{color:#00f}.value{color:red;left:500px}.comment{color:orange}

View File

@@ -0,0 +1,102 @@
<?php
unset( $GLOBALS['csstidy']['all_properties']['binding'] );
$GLOBALS['csstidy']['all_properties']['text-size-adjust'] = 'CSS3.0';
// Support browser prefixes for properties only in the latest CSS draft
foreach ( $GLOBALS['csstidy']['all_properties'] as $property => $levels ) {
if ( strpos( $levels, "," ) === false ) {
$GLOBALS['csstidy']['all_properties']['-moz-' . $property] = $levels;
$GLOBALS['csstidy']['all_properties']['-webkit-' . $property] = $levels;
$GLOBALS['csstidy']['all_properties']['-ms-' . $property] = $levels;
$GLOBALS['csstidy']['all_properties']['-o-' . $property] = $levels;
$GLOBALS['csstidy']['all_properties']['-khtml-' . $property] = $levels;
if ( in_array( $property, $GLOBALS['csstidy']['unit_values'] ) ) {
$GLOBALS['csstidy']['unit_values'][] = '-moz-' . $property;
$GLOBALS['csstidy']['unit_values'][] = '-webkit-' . $property;
$GLOBALS['csstidy']['unit_values'][] = '-ms-' . $property;
$GLOBALS['csstidy']['unit_values'][] = '-o-' . $property;
$GLOBALS['csstidy']['unit_values'][] = '-khtml-' . $property;
}
if ( in_array( $property, $GLOBALS['csstidy']['color_values'] ) ) {
$GLOBALS['csstidy']['color_values'][] = '-moz-' . $property;
$GLOBALS['csstidy']['color_values'][] = '-webkit-' . $property;
$GLOBALS['csstidy']['color_values'][] = '-ms-' . $property;
$GLOBALS['csstidy']['color_values'][] = '-o-' . $property;
$GLOBALS['csstidy']['color_values'][] = '-khtml-' . $property;
}
}
}
// Add `display` to the list of properties that can be used multiple times in a single selector
$GLOBALS['csstidy']['multiple_properties'][] = 'display';
// Allow vendor prefixes for any property that is allowed to be used multiple times inside a single selector
foreach ( $GLOBALS['csstidy']['multiple_properties'] as $property ) {
if ( '-' != $property[0] ) {
$GLOBALS['csstidy']['multiple_properties'][] = '-o-' . $property;
$GLOBALS['csstidy']['multiple_properties'][] = '-ms-' . $property;
$GLOBALS['csstidy']['multiple_properties'][] = '-webkit-' . $property;
$GLOBALS['csstidy']['multiple_properties'][] = '-moz-' . $property;
$GLOBALS['csstidy']['multiple_properties'][] = '-khtml-' . $property;
}
}
/**
* CSS Animation
*
* @see https://developer.mozilla.org/en/CSS/CSS_animations
*/
$GLOBALS['csstidy']['at_rules']['-webkit-keyframes'] = 'at';
$GLOBALS['csstidy']['at_rules']['-moz-keyframes'] = 'at';
$GLOBALS['csstidy']['at_rules']['-ms-keyframes'] = 'at';
$GLOBALS['csstidy']['at_rules']['-o-keyframes'] = 'at';
/**
* Non-standard viewport rule.
*/
$GLOBALS['csstidy']['at_rules']['viewport'] = 'is';
$GLOBALS['csstidy']['at_rules']['-webkit-viewport'] = 'is';
$GLOBALS['csstidy']['at_rules']['-moz-viewport'] = 'is';
$GLOBALS['csstidy']['at_rules']['-ms-viewport'] = 'is';
/**
* Non-standard CSS properties. They're not part of any spec, but we say
* they're in all of them so that we can support them.
*/
$GLOBALS['csstidy']['all_properties']['-webkit-filter'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['-moz-filter'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['-ms-filter'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['filter'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['scrollbar-face-color'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['-ms-interpolation-mode'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-rendering'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['-webkit-transform-origin-x'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['-webkit-transform-origin-y'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['-webkit-transform-origin-z'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['-webkit-font-smoothing'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['-moz-osx-font-smoothing'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['-font-smooth'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['-o-object-fit'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['object-fit'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['-o-object-position'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['object-position'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-overflow'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['zoom'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['pointer-events'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-feature-settings'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-kerning'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-language-override'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-synthesis'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-variant-alternates'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-variant-caps'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-variant-east-asian'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-variant-ligatures'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-variant-numeric'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-variant-position'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-variation-settings'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['line-height-step'] = 'CSS3.0';

View File

@@ -0,0 +1,693 @@
<?php
/**
* Various CSS Data for CSSTidy
*
* 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
*
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005
* @author Nikolay Matsievsky (speed at webo dot name) 2010
*/
define('AT_START', 1);
define('AT_END', 2);
define('SEL_START', 3);
define('SEL_END', 4);
define('PROPERTY', 5);
define('VALUE', 6);
define('COMMENT', 7);
define('DEFAULT_AT', 41);
/**
* All whitespace allowed in CSS
*
* @global array $GLOBALS['csstidy']['whitespace']
* @version 1.0
*/
$GLOBALS['csstidy']['whitespace'] = array(' ',"\n","\t","\r","\x0B");
/**
* All CSS tokens used by csstidy
*
* @global string $GLOBALS['csstidy']['tokens']
* @version 1.0
*/
$GLOBALS['csstidy']['tokens'] = '/@}{;:=\'"(,\\!$%&)*+.<>?[]^`|~';
/**
* All CSS units (CSS 3 units included)
*
* @see compress_numbers()
* @global array $GLOBALS['csstidy']['units']
* @version 1.0
*/
$GLOBALS['csstidy']['units'] = array('in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','ms','s','khz','hz');
/**
* Available at-rules
*
* @global array $GLOBALS['csstidy']['at_rules']
* @version 1.0
*/
$GLOBALS['csstidy']['at_rules'] = array('page' => 'is','font-face' => 'is','charset' => 'iv', 'import' => 'iv','namespace' => 'iv','media' => 'at','keyframes' => 'at', 'supports' => 'at');
/**
* Properties that need a value with unit
*
* @todo CSS3 properties
* @see compress_numbers();
* @global array $GLOBALS['csstidy']['unit_values']
* @version 1.2
*/
$GLOBALS['csstidy']['unit_values'] = array ('background', 'background-position', 'background-size', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-width',
'border-top-width', 'border-right-width', 'border-left-width', 'border-bottom-width', 'bottom', 'border-spacing', 'column-gap', 'column-width',
'font-size', 'height', 'left', 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'max-height',
'max-width', 'min-height', 'min-width', 'outline', 'outline-width', 'padding', 'padding-top', 'padding-right',
'padding-bottom', 'padding-left', 'perspective', 'right', 'top', 'text-indent', 'letter-spacing', 'word-spacing', 'width');
/**
* Properties that allow <color> as value
*
* @todo CSS3 properties
* @see compress_numbers();
* @global array $GLOBALS['csstidy']['color_values']
* @version 1.0
*/
$GLOBALS['csstidy']['color_values'] = array();
$GLOBALS['csstidy']['color_values'][] = 'background-color';
$GLOBALS['csstidy']['color_values'][] = 'border-color';
$GLOBALS['csstidy']['color_values'][] = 'border-top-color';
$GLOBALS['csstidy']['color_values'][] = 'border-right-color';
$GLOBALS['csstidy']['color_values'][] = 'border-bottom-color';
$GLOBALS['csstidy']['color_values'][] = 'border-left-color';
$GLOBALS['csstidy']['color_values'][] = 'color';
$GLOBALS['csstidy']['color_values'][] = 'outline-color';
$GLOBALS['csstidy']['color_values'][] = 'column-rule-color';
/**
* Default values for the background properties
*
* @todo Possibly property names will change during CSS3 development
* @global array $GLOBALS['csstidy']['background_prop_default']
* @see dissolve_short_bg()
* @see merge_bg()
* @version 1.0
*/
$GLOBALS['csstidy']['background_prop_default'] = array();
$GLOBALS['csstidy']['background_prop_default']['background-image'] = 'none';
$GLOBALS['csstidy']['background_prop_default']['background-size'] = 'auto';
$GLOBALS['csstidy']['background_prop_default']['background-repeat'] = 'repeat';
$GLOBALS['csstidy']['background_prop_default']['background-position'] = '0 0';
$GLOBALS['csstidy']['background_prop_default']['background-attachment'] = 'scroll';
$GLOBALS['csstidy']['background_prop_default']['background-clip'] = 'border';
$GLOBALS['csstidy']['background_prop_default']['background-origin'] = 'padding';
$GLOBALS['csstidy']['background_prop_default']['background-color'] = 'transparent';
/**
* Default values for the font properties
*
* @global array $GLOBALS['csstidy']['font_prop_default']
* @see merge_fonts()
* @version 1.3
*/
$GLOBALS['csstidy']['font_prop_default'] = array();
$GLOBALS['csstidy']['font_prop_default']['font-style'] = 'normal';
$GLOBALS['csstidy']['font_prop_default']['font-variant'] = 'normal';
$GLOBALS['csstidy']['font_prop_default']['font-weight'] = 'normal';
$GLOBALS['csstidy']['font_prop_default']['font-size'] = '';
$GLOBALS['csstidy']['font_prop_default']['line-height'] = '';
$GLOBALS['csstidy']['font_prop_default']['font-family'] = '';
/**
* A list of non-W3C color names which get replaced by their hex-codes
*
* @global array $GLOBALS['csstidy']['replace_colors']
* @see cut_color()
* @version 1.0
*/
$GLOBALS['csstidy']['replace_colors'] = array();
$GLOBALS['csstidy']['replace_colors']['aliceblue'] = '#f0f8ff';
$GLOBALS['csstidy']['replace_colors']['antiquewhite'] = '#faebd7';
$GLOBALS['csstidy']['replace_colors']['aquamarine'] = '#7fffd4';
$GLOBALS['csstidy']['replace_colors']['azure'] = '#f0ffff';
$GLOBALS['csstidy']['replace_colors']['beige'] = '#f5f5dc';
$GLOBALS['csstidy']['replace_colors']['bisque'] = '#ffe4c4';
$GLOBALS['csstidy']['replace_colors']['blanchedalmond'] = '#ffebcd';
$GLOBALS['csstidy']['replace_colors']['blueviolet'] = '#8a2be2';
$GLOBALS['csstidy']['replace_colors']['brown'] = '#a52a2a';
$GLOBALS['csstidy']['replace_colors']['burlywood'] = '#deb887';
$GLOBALS['csstidy']['replace_colors']['cadetblue'] = '#5f9ea0';
$GLOBALS['csstidy']['replace_colors']['chartreuse'] = '#7fff00';
$GLOBALS['csstidy']['replace_colors']['chocolate'] = '#d2691e';
$GLOBALS['csstidy']['replace_colors']['coral'] = '#ff7f50';
$GLOBALS['csstidy']['replace_colors']['cornflowerblue'] = '#6495ed';
$GLOBALS['csstidy']['replace_colors']['cornsilk'] = '#fff8dc';
$GLOBALS['csstidy']['replace_colors']['crimson'] = '#dc143c';
$GLOBALS['csstidy']['replace_colors']['cyan'] = '#00ffff';
$GLOBALS['csstidy']['replace_colors']['darkblue'] = '#00008b';
$GLOBALS['csstidy']['replace_colors']['darkcyan'] = '#008b8b';
$GLOBALS['csstidy']['replace_colors']['darkgoldenrod'] = '#b8860b';
$GLOBALS['csstidy']['replace_colors']['darkgray'] = '#a9a9a9';
$GLOBALS['csstidy']['replace_colors']['darkgreen'] = '#006400';
$GLOBALS['csstidy']['replace_colors']['darkkhaki'] = '#bdb76b';
$GLOBALS['csstidy']['replace_colors']['darkmagenta'] = '#8b008b';
$GLOBALS['csstidy']['replace_colors']['darkolivegreen'] = '#556b2f';
$GLOBALS['csstidy']['replace_colors']['darkorange'] = '#ff8c00';
$GLOBALS['csstidy']['replace_colors']['darkorchid'] = '#9932cc';
$GLOBALS['csstidy']['replace_colors']['darkred'] = '#8b0000';
$GLOBALS['csstidy']['replace_colors']['darksalmon'] = '#e9967a';
$GLOBALS['csstidy']['replace_colors']['darkseagreen'] = '#8fbc8f';
$GLOBALS['csstidy']['replace_colors']['darkslateblue'] = '#483d8b';
$GLOBALS['csstidy']['replace_colors']['darkslategray'] = '#2f4f4f';
$GLOBALS['csstidy']['replace_colors']['darkturquoise'] = '#00ced1';
$GLOBALS['csstidy']['replace_colors']['darkviolet'] = '#9400d3';
$GLOBALS['csstidy']['replace_colors']['deeppink'] = '#ff1493';
$GLOBALS['csstidy']['replace_colors']['deepskyblue'] = '#00bfff';
$GLOBALS['csstidy']['replace_colors']['dimgray'] = '#696969';
$GLOBALS['csstidy']['replace_colors']['dodgerblue'] = '#1e90ff';
$GLOBALS['csstidy']['replace_colors']['feldspar'] = '#d19275';
$GLOBALS['csstidy']['replace_colors']['firebrick'] = '#b22222';
$GLOBALS['csstidy']['replace_colors']['floralwhite'] = '#fffaf0';
$GLOBALS['csstidy']['replace_colors']['forestgreen'] = '#228b22';
$GLOBALS['csstidy']['replace_colors']['gainsboro'] = '#dcdcdc';
$GLOBALS['csstidy']['replace_colors']['ghostwhite'] = '#f8f8ff';
$GLOBALS['csstidy']['replace_colors']['gold'] = '#ffd700';
$GLOBALS['csstidy']['replace_colors']['goldenrod'] = '#daa520';
$GLOBALS['csstidy']['replace_colors']['greenyellow'] = '#adff2f';
$GLOBALS['csstidy']['replace_colors']['honeydew'] = '#f0fff0';
$GLOBALS['csstidy']['replace_colors']['hotpink'] = '#ff69b4';
$GLOBALS['csstidy']['replace_colors']['indianred'] = '#cd5c5c';
$GLOBALS['csstidy']['replace_colors']['indigo'] = '#4b0082';
$GLOBALS['csstidy']['replace_colors']['ivory'] = '#fffff0';
$GLOBALS['csstidy']['replace_colors']['khaki'] = '#f0e68c';
$GLOBALS['csstidy']['replace_colors']['lavender'] = '#e6e6fa';
$GLOBALS['csstidy']['replace_colors']['lavenderblush'] = '#fff0f5';
$GLOBALS['csstidy']['replace_colors']['lawngreen'] = '#7cfc00';
$GLOBALS['csstidy']['replace_colors']['lemonchiffon'] = '#fffacd';
$GLOBALS['csstidy']['replace_colors']['lightblue'] = '#add8e6';
$GLOBALS['csstidy']['replace_colors']['lightcoral'] = '#f08080';
$GLOBALS['csstidy']['replace_colors']['lightcyan'] = '#e0ffff';
$GLOBALS['csstidy']['replace_colors']['lightgoldenrodyellow'] = '#fafad2';
$GLOBALS['csstidy']['replace_colors']['lightgrey'] = '#d3d3d3';
$GLOBALS['csstidy']['replace_colors']['lightgreen'] = '#90ee90';
$GLOBALS['csstidy']['replace_colors']['lightpink'] = '#ffb6c1';
$GLOBALS['csstidy']['replace_colors']['lightsalmon'] = '#ffa07a';
$GLOBALS['csstidy']['replace_colors']['lightseagreen'] = '#20b2aa';
$GLOBALS['csstidy']['replace_colors']['lightskyblue'] = '#87cefa';
$GLOBALS['csstidy']['replace_colors']['lightslateblue'] = '#8470ff';
$GLOBALS['csstidy']['replace_colors']['lightslategray'] = '#778899';
$GLOBALS['csstidy']['replace_colors']['lightsteelblue'] = '#b0c4de';
$GLOBALS['csstidy']['replace_colors']['lightyellow'] = '#ffffe0';
$GLOBALS['csstidy']['replace_colors']['limegreen'] = '#32cd32';
$GLOBALS['csstidy']['replace_colors']['linen'] = '#faf0e6';
$GLOBALS['csstidy']['replace_colors']['magenta'] = '#ff00ff';
$GLOBALS['csstidy']['replace_colors']['mediumaquamarine'] = '#66cdaa';
$GLOBALS['csstidy']['replace_colors']['mediumblue'] = '#0000cd';
$GLOBALS['csstidy']['replace_colors']['mediumorchid'] = '#ba55d3';
$GLOBALS['csstidy']['replace_colors']['mediumpurple'] = '#9370d8';
$GLOBALS['csstidy']['replace_colors']['mediumseagreen'] = '#3cb371';
$GLOBALS['csstidy']['replace_colors']['mediumslateblue'] = '#7b68ee';
$GLOBALS['csstidy']['replace_colors']['mediumspringgreen'] = '#00fa9a';
$GLOBALS['csstidy']['replace_colors']['mediumturquoise'] = '#48d1cc';
$GLOBALS['csstidy']['replace_colors']['mediumvioletred'] = '#c71585';
$GLOBALS['csstidy']['replace_colors']['midnightblue'] = '#191970';
$GLOBALS['csstidy']['replace_colors']['mintcream'] = '#f5fffa';
$GLOBALS['csstidy']['replace_colors']['mistyrose'] = '#ffe4e1';
$GLOBALS['csstidy']['replace_colors']['moccasin'] = '#ffe4b5';
$GLOBALS['csstidy']['replace_colors']['navajowhite'] = '#ffdead';
$GLOBALS['csstidy']['replace_colors']['oldlace'] = '#fdf5e6';
$GLOBALS['csstidy']['replace_colors']['olivedrab'] = '#6b8e23';
$GLOBALS['csstidy']['replace_colors']['orangered'] = '#ff4500';
$GLOBALS['csstidy']['replace_colors']['orchid'] = '#da70d6';
$GLOBALS['csstidy']['replace_colors']['palegoldenrod'] = '#eee8aa';
$GLOBALS['csstidy']['replace_colors']['palegreen'] = '#98fb98';
$GLOBALS['csstidy']['replace_colors']['paleturquoise'] = '#afeeee';
$GLOBALS['csstidy']['replace_colors']['palevioletred'] = '#d87093';
$GLOBALS['csstidy']['replace_colors']['papayawhip'] = '#ffefd5';
$GLOBALS['csstidy']['replace_colors']['peachpuff'] = '#ffdab9';
$GLOBALS['csstidy']['replace_colors']['peru'] = '#cd853f';
$GLOBALS['csstidy']['replace_colors']['pink'] = '#ffc0cb';
$GLOBALS['csstidy']['replace_colors']['plum'] = '#dda0dd';
$GLOBALS['csstidy']['replace_colors']['powderblue'] = '#b0e0e6';
$GLOBALS['csstidy']['replace_colors']['rosybrown'] = '#bc8f8f';
$GLOBALS['csstidy']['replace_colors']['royalblue'] = '#4169e1';
$GLOBALS['csstidy']['replace_colors']['saddlebrown'] = '#8b4513';
$GLOBALS['csstidy']['replace_colors']['salmon'] = '#fa8072';
$GLOBALS['csstidy']['replace_colors']['sandybrown'] = '#f4a460';
$GLOBALS['csstidy']['replace_colors']['seagreen'] = '#2e8b57';
$GLOBALS['csstidy']['replace_colors']['seashell'] = '#fff5ee';
$GLOBALS['csstidy']['replace_colors']['sienna'] = '#a0522d';
$GLOBALS['csstidy']['replace_colors']['skyblue'] = '#87ceeb';
$GLOBALS['csstidy']['replace_colors']['slateblue'] = '#6a5acd';
$GLOBALS['csstidy']['replace_colors']['slategray'] = '#708090';
$GLOBALS['csstidy']['replace_colors']['snow'] = '#fffafa';
$GLOBALS['csstidy']['replace_colors']['springgreen'] = '#00ff7f';
$GLOBALS['csstidy']['replace_colors']['steelblue'] = '#4682b4';
$GLOBALS['csstidy']['replace_colors']['tan'] = '#d2b48c';
$GLOBALS['csstidy']['replace_colors']['thistle'] = '#d8bfd8';
$GLOBALS['csstidy']['replace_colors']['tomato'] = '#ff6347';
$GLOBALS['csstidy']['replace_colors']['turquoise'] = '#40e0d0';
$GLOBALS['csstidy']['replace_colors']['violet'] = '#ee82ee';
$GLOBALS['csstidy']['replace_colors']['violetred'] = '#d02090';
$GLOBALS['csstidy']['replace_colors']['wheat'] = '#f5deb3';
$GLOBALS['csstidy']['replace_colors']['whitesmoke'] = '#f5f5f5';
$GLOBALS['csstidy']['replace_colors']['yellowgreen'] = '#9acd32';
/**
* A list of all shorthand properties that are divided into four properties and/or have four subvalues
*
* @global array $GLOBALS['csstidy']['shorthands']
* @todo Are there new ones in CSS3?
* @see dissolve_4value_shorthands()
* @see merge_4value_shorthands()
* @version 1.0
*/
$GLOBALS['csstidy']['shorthands'] = array();
$GLOBALS['csstidy']['shorthands']['border-color'] = array('border-top-color','border-right-color','border-bottom-color','border-left-color');
$GLOBALS['csstidy']['shorthands']['border-style'] = array('border-top-style','border-right-style','border-bottom-style','border-left-style');
$GLOBALS['csstidy']['shorthands']['border-width'] = array('border-top-width','border-right-width','border-bottom-width','border-left-width');
$GLOBALS['csstidy']['shorthands']['margin'] = array('margin-top','margin-right','margin-bottom','margin-left');
$GLOBALS['csstidy']['shorthands']['padding'] = array('padding-top','padding-right','padding-bottom','padding-left');
$GLOBALS['csstidy']['shorthands']['-moz-border-radius'] = 0;
/**
* All CSS Properties. Needed for csstidy::property_is_next()
*
* @global array $GLOBALS['csstidy']['all_properties']
* @todo Add CSS3 properties
* @version 1.0
* @see csstidy::property_is_next()
*/
$GLOBALS['csstidy']['all_properties']['align-content'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['align-items'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['align-self'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['alignment-adjust'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['alignment-baseline'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['animation'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['animation-delay'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['animation-direction'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['animation-duration'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['animation-fill-mode'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['animation-iteration-count'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['animation-name'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['animation-play-state'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['animation-timing-function'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['appearance'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['azimuth'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['backface-visibility'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['background'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['background-clip'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['background-color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['background-image'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['background-origin'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['background-position'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['background-size'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['baseline-shift'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['binding'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['bleed'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['bookmark-label'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['bookmark-level'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['bookmark-state'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['bookmark-target'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-bottom-color'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-bottom-left-radius'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-bottom-right-radius'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-bottom-style'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-bottom-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-collapse'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-image'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-image-outset'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-image-repeat'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-image-slice'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-image-source'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-image-width'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-left-color'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-left-style'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-left-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-radius'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-right-color'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-right-style'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-right-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-spacing'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-top-color'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-top-left-radius'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-top-right-radius'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-top-style'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-top-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['border-width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['bottom'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['box-decoration-break'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['box-shadow'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['box-sizing'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['break-after'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['break-before'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['break-inside'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['caption-side'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['clear'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['clip'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['color'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['color-profile'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['column-count'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['column-fill'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['column-gap'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['column-rule'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['column-rule-color'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['column-rule-style'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['column-rule-width'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['column-span'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['column-width'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['columns'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['content'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['counter-increment'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['counter-reset'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['crop'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['cue'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['cue-after'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['cue-before'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['cursor'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['direction'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['display'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['dominant-baseline'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['drop-initial-after-adjust'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['drop-initial-after-align'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['drop-initial-before-adjust'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['drop-initial-before-align'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['drop-initial-size'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['drop-initial-value'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['elevation'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['empty-cells'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['fill'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['fit'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['fit-position'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex-align'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex-basis'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex-direction'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex-flow'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex-grow'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex-line-pack'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex-order'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex-pack'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex-shrink'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['flex-wrap'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['float'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['float-offset'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['font'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-family'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-size'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-size-adjust'] = 'CSS2.0,CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-stretch'] = 'CSS2.0,CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-area'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-auto-columns'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-auto-flow'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-auto-rows'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-column'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-columns'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-column-end'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-column-gap'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-column-start'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-gap'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-row'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-rows'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-row-end'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-row-gap'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-row-start'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-template'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-template-areas'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-template-columns'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['grid-template-rows'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['hanging-punctuation'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['height'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['hyphenate-after'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['hyphenate-before'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['hyphenate-character'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['hyphenate-lines'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['hyphenate-resource'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['hyphens'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['icon'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['image-orientation'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['image-rendering'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['image-resolution'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['inline-box-align'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['justify-content'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['justify-items'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['justify-self'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['left'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['letter-spacing'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['line-break'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['line-height'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['line-stacking'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['line-stacking-ruby'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['line-stacking-shift'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['line-stacking-strategy'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['list-style'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['list-style-image'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['list-style-position'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['list-style-type'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['margin'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['marker-offset'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['marks'] = 'CSS2.0,CSS3.0';
$GLOBALS['csstidy']['all_properties']['marquee-direction'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['marquee-loop'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['marquee-play-count'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['marquee-speed'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['marquee-style'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['max-height'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['max-width'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['min-height'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['min-width'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['move-to'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['nav-down'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['nav-index'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['nav-left'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['nav-right'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['nav-up'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['opacity'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['order'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['orphans'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['outline'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['outline-color'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['outline-offset'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['outline-style'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['outline-width'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['overflow'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['overflow-style'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['overflow-wrap'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['overflow-x'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['overflow-y'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['padding'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['padding-bottom'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['padding-left'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['padding-right'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['padding-top'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['page'] = 'CSS2.0,CSS3.0';
$GLOBALS['csstidy']['all_properties']['page-break-after'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['page-break-before'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['page-break-inside'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['page-policy'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['pause'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['pause-after'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['pause-before'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['perspective'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['perspective-origin'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['phonemes'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['pitch'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['pitch-range'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['play-during'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['position'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['presentation-level'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['punctuation-trim'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['quotes'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['rendering-intent'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['resize'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['rest'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['rest-after'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['rest-before'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['richness'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['right'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['rotation'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['rotation-point'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['ruby-align'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['ruby-overhang'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['ruby-position'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['ruby-span'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['size'] = 'CSS2.0,CSS3.0';
$GLOBALS['csstidy']['all_properties']['speak'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['speak-header'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['speak-numeral'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['speak-punctuation'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['speech-rate'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['src'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['stress'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['string-set'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['stroke'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['tab-size'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['table-layout'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['target'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['target-name'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['target-new'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['target-position'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-align'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-align-last'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-decoration'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-decoration-color'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-decoration-line'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-decoration-skip'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-decoration-style'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-emphasis'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-emphasis-color'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-emphasis-position'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-emphasis-style'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-height'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-justify'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-outline'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-shadow'] = 'CSS2.0,CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-space-collapse'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-underline-position'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['text-wrap'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['top'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['transform'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['transform-origin'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['transform-style'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['transition'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['transition-delay'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['transition-duration'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['transition-property'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['transition-timing-function'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['unicode-bidi'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['vertical-align'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['visibility'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['voice-balance'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['voice-duration'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['voice-family'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['voice-pitch'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['voice-pitch-range'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['voice-rate'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['voice-stress'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['voice-volume'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['volume'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['white-space'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['widows'] = 'CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['width'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['word-break'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1,CSS3.0';
$GLOBALS['csstidy']['all_properties']['word-wrap'] = 'CSS3.0';
$GLOBALS['csstidy']['all_properties']['z-index'] = 'CSS2.0,CSS2.1,CSS3.0';
/**
* An array containing all properties that can accept a quoted string as a value.
*
* @global array $GLOBALS['csstidy']['quoted_string_properties']
*/
$GLOBALS['csstidy']['quoted_string_properties'] = array('content', 'font', 'font-family', 'quotes');
/**
* An array containing all properties that can be defined multiple times without being overwritten.
* All unit values are included so that units like rem can be supported with fallbacks to px or em.
*
* @global array $GLOBALS['csstidy']['quoted_string_properties']
*/
$GLOBALS['csstidy']['multiple_properties'] = array_merge( $GLOBALS['csstidy']['color_values'], $GLOBALS['csstidy']['unit_values'], array( 'transition', 'background-image', 'border-image', 'list-style-image' ) );
/**
* An array containing all predefined templates.
*
* @global array $GLOBALS['csstidy']['predefined_templates']
* @version 1.0
* @see csstidy::load_template()
*/
$GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="at">'; //string before @rule
$GLOBALS['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after @-rule
$GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="selector">'; //string before selector
$GLOBALS['csstidy']['predefined_templates']['default'][] = '</span> <span class="format">{</span>'."\n"; //bracket after selector
$GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="property">'; //string before property
$GLOBALS['csstidy']['predefined_templates']['default'][] = '</span><span class="value">'; //string after property+before value
$GLOBALS['csstidy']['predefined_templates']['default'][] = '</span><span class="format">;</span>'."\n"; //string after value
$GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="format">}</span>'; //closing bracket - selector
$GLOBALS['csstidy']['predefined_templates']['default'][] = "\n\n"; //space between blocks {...}
$GLOBALS['csstidy']['predefined_templates']['default'][] = "\n".'<span class="format">}</span>'. "\n\n"; //closing bracket @-rule
$GLOBALS['csstidy']['predefined_templates']['default'][] = ''; //indent in @-rule
$GLOBALS['csstidy']['predefined_templates']['default'][] = '<span class="comment">'; // before comment
$GLOBALS['csstidy']['predefined_templates']['default'][] = '</span>'."\n"; // after comment
$GLOBALS['csstidy']['predefined_templates']['default'][] = "\n"; // after last line @-rule
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="at">';
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span> <span class="format">{</span>'."\n";
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="selector">';
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">{</span>';
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="property">';
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="value">';
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span><span class="format">;</span>';
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="format">}</span>';
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n";
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n". '<span class="format">}'."\n".'</span>';
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '';
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '<span class="comment">'; // before comment
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = '</span>'; // after comment
$GLOBALS['csstidy']['predefined_templates']['high_compression'][] = "\n";
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="at">';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="selector">';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">{</span>';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="property">';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="value">';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span><span class="format">;</span>';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="format">}</span>';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '<span class="comment">'; // before comment
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '</span>'; // after comment
$GLOBALS['csstidy']['predefined_templates']['highest_compression'][] = '';
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="at">';
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span> <span class="format">{</span>'."\n";
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="selector">';
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n".'<span class="format">{</span>'."\n";
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' <span class="property">';
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="value">';
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span><span class="format">;</span>'."\n";
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="format">}</span>';
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n\n";
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n".'<span class="format">}</span>'."\n\n";
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = ' ';
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '<span class="comment">'; // before comment
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = '</span>'."\n"; // after comment
$GLOBALS['csstidy']['predefined_templates']['low_compression'][] = "\n";
require dirname( __FILE__ ) . '/data-wp.inc.php';

View File

@@ -0,0 +1,308 @@
<?php
/**
* Localization of CSS Optimiser Interface of CSSTidy
*
* Copyright 2005, 2006, 2007 Florian Schmitz
*
* This file is part of CSSTidy.
*
* CSSTidy is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005-2007
* @author Brett Zamir (brettz9 at yahoo dot com) 2007
*/
if ( isset( $_GET['lang'] ) ) {
$l = $_GET['lang'];
} elseif ( isset( $_SERVER['HTTP_ACCEPT_LANGUAGE'] ) ) {
$l = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$l = strtolower( substr( $l, 0, 2 ) );
} else {
$l = '';
}
$l = ( in_array( $l, array( 'de', 'fr', 'zh' ) ) ) ? $l : 'en';
// note 5 in all but French, and 40 in all are orphaned
$lang = array();
$lang['en'][0] = 'CSS Formatter and Optimiser/Optimizer (based on CSSTidy ';
$lang['en'][1] = 'CSS Formatter and Optimiser';
$lang['en'][2] = '(based on';
$lang['en'][3] = '(plaintext)';
$lang['en'][4] = 'Important Note:';
$lang['en'][6] = 'Your code should be well-formed. This is <strong>not a validator</strong> which points out errors in your CSS code. To make sure that your code is valid, use the <a href="http://jigsaw.w3.org/css-validator/">W3C Validator</a>.';
$lang['en'][7] = 'all comments are removed';
$lang['en'][8] = 'CSS Input:';
$lang['en'][9] = 'CSS-Code:';
$lang['en'][10] = 'CSS from URL:';
$lang['en'][11] = 'Code Layout:';
$lang['en'][12] = 'Compression&#160;(code&#160;layout):';
$lang['en'][13] = 'Highest (no readability, smallest size)';
$lang['en'][14] = 'High (moderate readability, smaller size)';
$lang['en'][15] = 'Standard (balance between readability and size)';
$lang['en'][16] = 'Low (higher readability)';
$lang['en'][17] = 'Custom (enter below)';
$lang['en'][18] = 'Custom <a href="http://csstidy.sourceforge.net/templates.php">template</a>';
$lang['en'][19] = 'Options';
$lang['en'][20] = 'Sort Selectors (caution)';
$lang['en'][21] = 'Sort Properties';
$lang['en'][22] = 'Regroup selectors';
$lang['en'][23] = 'Optimise shorthands';
$lang['en'][24] = 'Compress colors';
$lang['en'][25] = 'Lowercase selectors';
$lang['en'][26] = 'Case for properties:';
$lang['en'][27] = 'Lowercase';
$lang['en'][28] = 'No or invalid CSS input or wrong URL!';
$lang['en'][29] = 'Uppercase';
$lang['en'][30] = 'lowercase elementnames needed for XHTML';
$lang['en'][31] = 'Remove unnecessary backslashes';
$lang['en'][32] = 'convert !important-hack';
$lang['en'][33] = 'Output as file';
$lang['en'][34] = 'Bigger compression because of smaller newlines (copy &#38; paste doesn\'t work)';
$lang['en'][35] = 'Process CSS';
$lang['en'][36] = 'Compression Ratio';
$lang['en'][37] = 'Input';
$lang['en'][38] = 'Output';
$lang['en'][39] = 'Language';
$lang['en'][41] = 'Attention: This may change the behavior of your CSS Code!';
$lang['en'][42] = 'Remove last ;';
$lang['en'][43] = 'Discard invalid properties';
$lang['en'][44] = 'Only safe optimisations';
$lang['en'][45] = 'Compress font-weight';
$lang['en'][46] = 'Save comments';
$lang['en'][47] = 'Do not change anything';
$lang['en'][48] = 'Only separate selectors (split at ,)';
$lang['en'][49] = 'Merge selectors with the same properties (fast)';
$lang['en'][50] = 'Merge selectors intelligently (slow)';
$lang['en'][51] = 'Preserve CSS';
$lang['en'][52] = 'Save comments, hacks, etc. Most optimisations can *not* be applied if this is enabled.';
$lang['en'][53] = 'None';
$lang['en'][54] = 'Don\'t optimise';
$lang['en'][55] = 'Safe optimisations';
$lang['en'][56] = 'All optimisations';
$lang['en'][57] = 'Add timestamp';
$lang['en'][58] = 'Copy to clipboard';
$lang['en'][59] = 'Back to top';
$lang['en'][60] = 'Your browser doesn\'t support copy to clipboard.';
$lang['en'][61] = 'For bugs and suggestions feel free to';
$lang['en'][62] = 'contact me';
$lang['en'][63] = 'Output CSS code as complete HTML document';
$lang['en'][64] = 'Code';
$lang['en'][65] = 'CSS to style CSS output';
$lang['en'][66] = 'You need to go to about:config in your URL bar, select \'signed.applets.codebase_principal_support\' in the filter field, and set its value to true in order to use this feature; however, be aware that doing so increases security risks.';
$lang['de'][0] = 'CSS Formatierer und Optimierer (basierend auf CSSTidy ';
$lang['de'][1] = 'CSS Formatierer und Optimierer';
$lang['de'][2] = '(basierend auf';
$lang['de'][3] = '(Textversion)';
$lang['de'][4] = 'Wichtiger Hinweis:';
$lang['de'][6] = 'Der CSS Code sollte wohlgeformt sein. Der CSS Code wird <strong>nicht auf Gültigkeit überprüft</strong>. Um sicherzugehen dass dein Code valide ist, benutze den <a href="http://jigsaw.w3.org/css-validator/">W3C Validierungsservice</a>.';
$lang['de'][7] = 'alle Kommentare werden entfernt';
$lang['de'][8] = 'CSS Eingabe:';
$lang['de'][9] = 'CSS-Code:';
$lang['de'][10] = 'CSS von URL:';
$lang['de'][11] = 'Code Layout:';
$lang['de'][12] = 'Komprimierung&#160;(Code&#160;Layout):';
$lang['de'][13] = 'Höchste (keine Lesbarkeit, niedrigste Größe)';
$lang['de'][14] = 'Hoch (mittelmäßige Lesbarkeit, geringe Größe)';
$lang['de'][15] = 'Standard (Kompromiss zwischen Lesbarkeit und Größe)';
$lang['de'][16] = 'Niedrig (höhere Lesbarkeit)';
$lang['de'][17] = 'Benutzerdefiniert (unten eingeben)';
$lang['de'][18] = 'Benutzerdefinierte <a href="http://csstidy.sourceforge.net/templates.php">Vorlage</a>';
$lang['de'][19] = 'Optionen';
$lang['de'][20] = 'Selektoren sortieren (Vorsicht)';
$lang['de'][21] = 'Eigenschaften sortieren';
$lang['de'][22] = 'Selektoren umgruppieren';
$lang['de'][23] = 'Shorthands optimieren';
$lang['de'][24] = 'Farben komprimieren';
$lang['de'][25] = 'Selektoren in Kleinbuchstaben';
$lang['de'][26] = 'Groß-/Kleinschreibung für Eigenschaften';
$lang['de'][27] = 'Kleinbuchstaben';
$lang['de'][28] = 'Keine oder ungültige CSS Eingabe oder falsche URL!';
$lang['de'][29] = 'Großbuchstaben';
$lang['de'][30] = 'kleingeschriebene Elementnamen benötigt für XHTML';
$lang['de'][31] = 'Unnötige Backslashes entfernen';
$lang['de'][32] = '!important-Hack konvertieren';
$lang['de'][33] = 'Als Datei ausgeben';
$lang['de'][34] = 'Größere Komprimierung augrund von kleineren Neuezeile-Zeichen';
$lang['de'][35] = 'CSS verarbeiten';
$lang['de'][36] = 'Komprimierungsrate';
$lang['de'][37] = 'Eingabe';
$lang['de'][38] = 'Ausgabe';
$lang['de'][39] = 'Sprache';
$lang['de'][41] = 'Achtung: Dies könnte das Verhalten ihres CSS-Codes verändern!';
$lang['de'][42] = 'Letztes ; entfernen';
$lang['de'][43] = 'Ungültige Eigenschaften entfernen';
$lang['de'][44] = 'Nur sichere Optimierungen';
$lang['de'][45] = 'font-weight komprimieren';
$lang['de'][46] = 'Kommentare beibehalten';
$lang['de'][47] = 'Nichts ändern';
$lang['de'][48] = 'Selektoren nur trennen (am Komma)';
$lang['de'][49] = 'Selektoren mit gleichen Eigenschaften zusammenfassen (schnell)';
$lang['de'][50] = 'Selektoren intelligent zusammenfassen (langsam!)';
$lang['de'][51] = 'CSS erhalten';
$lang['de'][52] = 'Kommentare, Hacks, etc. speichern. Viele Optimierungen sind dann aber nicht mehr möglich.';
$lang['de'][53] = 'Keine';
$lang['de'][54] = 'Nicht optimieren';
$lang['de'][55] = 'Sichere Optimierungen';
$lang['de'][56] = 'Alle Optimierungen';
$lang['de'][57] = 'Zeitstempel hinzufügen';
$lang['de'][58] = 'Copy to clipboard';
$lang['de'][59] = 'Back to top';
$lang['de'][60] = 'Your browser doesn\'t support copy to clipboard.';
$lang['de'][61] = 'For bugs and suggestions feel free to';
$lang['de'][62] = 'contact me';
$lang['de'][63] = 'Output CSS code as complete HTML document';
$lang['de'][64] = 'Code';
$lang['de'][65] = 'CSS to style CSS output';
$lang['de'][66] = 'You need to go to about:config in your URL bar, select \'signed.applets.codebase_principal_support\' in the filter field, and set its value to true in order to use this feature; however, be aware that doing so increases security risks.';
$lang['fr'][0] = 'CSS Formatteur et Optimiseur (basé sur CSSTidy ';
$lang['fr'][1] = 'CSS Formatteur et Optimiseur';
$lang['fr'][2] = '(basé sur ';
$lang['fr'][3] = '(Version texte)';
$lang['fr'][4] = 'Note Importante&#160;:';
$lang['fr'][6] = 'Votre code doit être valide. Ce nest <strong>pas un validateur</strong> qui signale les erreurs dans votre code CSS. Pour être sûr que votre code est correct, utilisez le validateur&#160;: <a href="http://jigsaw.w3.org/css-validator/">W3C Validator</a>.';
$lang['fr'][7] = 'tous les commentaires sont enlevés';
$lang['fr'][8] = 'Champ CSS&#160;:';
$lang['fr'][9] = 'Code CSS&#160;:';
$lang['fr'][10] = 'CSS en provenance dune URL&#160;:<br />';
$lang['fr'][11] = 'Mise en page du code&#160;:';
$lang['fr'][12] = 'Compression (mise en page du code)&#160;:';
$lang['fr'][13] = 'La plus élevée (aucune lisibilité, taille minimale)';
$lang['fr'][14] = 'Élevée (lisibilité modérée, petite taille)';
$lang['fr'][15] = 'Normale (équilibre entre lisibilité et taille)';
$lang['fr'][16] = 'Faible (lisibilité élevée)';
$lang['fr'][17] = 'Sur mesure (entrer ci-dessous)';
$lang['fr'][18] = '<a href="http://csstidy.sourceforge.net/templates.php">Gabarit</a> sur mesure';
$lang['fr'][19] = 'Options';
$lang['fr'][20] = 'Trier les sélecteurs (attention)';
$lang['fr'][21] = 'Trier les propriétés';
$lang['fr'][22] = 'Regrouper les sélecteurs';
$lang['fr'][23] = 'Propriétés raccourcies';
$lang['fr'][24] = 'Compresser les couleurs';
$lang['fr'][25] = 'Sélecteurs en minuscules';
$lang['fr'][26] = 'Case pour les propriétés&#160;:';
$lang['fr'][27] = 'Minuscule';
$lang['fr'][28] = 'CSS non valide ou URL incorrecte&#160;!';
$lang['fr'][29] = 'Majuscule';
$lang['fr'][30] = 'les noms des éléments en minuscules (indispensables pour XHTML)';
$lang['fr'][31] = 'enlever les antislashs inutiles';
$lang['fr'][32] = 'convertir !important-hack';
$lang['fr'][33] = 'Sauver en tant que fichier';
$lang['fr'][34] = 'Meilleure compression grâce aux caractères de saut de ligne plus petits (copier &#38; coller ne marche pas)';
$lang['fr'][35] = 'Compresser la CSS';
$lang['fr'][36] = 'Facteur de Compression';
$lang['fr'][37] = 'Entrée';
$lang['fr'][38] = 'Sortie';
$lang['fr'][39] = 'Langue';
$lang['fr'][41] = 'Attention&#160;: ceci peut changer le comportement de votre code CSS&#160;!';
$lang['fr'][42] = 'Enlever le dernier ;';
$lang['fr'][43] = 'Supprimer les propriétés non valide';
$lang['fr'][44] = 'Seulement les optimisations sûres';
$lang['fr'][45] = 'Compresser font-weight';
$lang['fr'][46] = 'Sauvegarder les commentaires ';
$lang['fr'][47] = 'Ne rien changer';
$lang['fr'][48] = 'Sépare les sélecteurs (sépare au niveau de ,)';
$lang['fr'][49] = 'Fusionne les sélecteurs avec les mêmes propriétés (rapide)';
$lang['fr'][50] = 'Fusionne les sélecteurs intelligemment (lent)';
$lang['fr'][51] = 'Préserver la CSS';
$lang['fr'][52] = 'Sauvegarder les commentaires, hacks, etc. La plupart des optimisations ne peuvent *pas* être appliquées si cela est activé.';
$lang['fr'][53] = 'Aucun';
$lang['fr'][54] = 'Ne pas optimiser';
$lang['fr'][55] = 'Optimisations sûres';
$lang['fr'][56] = 'Toutes les optimisations';
$lang['fr'][57] = 'Ajouter un timestamp';
$lang['fr'][58] = 'Copier dans le presse-papiers';
$lang['fr'][59] = 'Retour en haut';
$lang['fr'][60] = 'Votre navigateur ne suporte pas la copie vers le presse-papiers.';
$lang['fr'][61] = 'Pour signaler des bugs ou pour des suggestions,';
$lang['fr'][62] = 'contactez-moi';
$lang['fr'][63] = 'Sauver le code CSS comme document complet HTML';
$lang['fr'][64] = 'Code';
$lang['fr'][65] = 'CSS pour colorier la sortie CSS';
$lang['fr'][66] = 'Vous devez aller dans about:config dans votre barre dadresse, selectionner \'signed.applets.codebase_principal_support\' dans le champ Filtre et attribuez-lui la valeur \'true\' pour utiliser cette fonctionnalité; toutefois, soyez conscient que cela augmente les risques de sécurité.';
$lang['zh'][0] = 'CSS整形與最佳化工具(使用 CSSTidy ';
$lang['zh'][1] = 'CSS整形與最佳化工具';
$lang['zh'][2] = '(使用';
$lang['zh'][3] = '(純文字)';
$lang['zh'][4] = '重要事項:';
$lang['zh'][6] = '你的原始碼必須是良構的(well-formed). 這個工具<strong>沒有內建驗證器(validator)</strong>. 驗證器能夠指出你CSS原始碼裡的錯誤. 請使用 <a href="http://jigsaw.w3.org/css-validator/">W3C 驗證器</a>, 確保你的原始碼合乎規範.';
$lang['zh'][7] = '所有註解都移除了';
$lang['zh'][8] = 'CSS 輸入:';
$lang['zh'][9] = 'CSS 原始碼:';
$lang['zh'][10] = 'CSS 檔案網址(URL):';
$lang['zh'][11] = '原始碼規劃:';
$lang['zh'][12] = '壓縮程度(原始碼規劃):';
$lang['zh'][13] = '最高 (沒有辦法讀, 檔案最小)';
$lang['zh'][14] = '高 (適度的可讀性, 檔案小)';
$lang['zh'][15] = '標準 (兼顧可讀性與檔案大小)';
$lang['zh'][16] = '低 (注重可讀性)';
$lang['zh'][17] = '自訂 (在下方設定)';
$lang['zh'][18] = '自訂<a href="http://csstidy.sourceforge.net/templates.php">樣板</a>';
$lang['zh'][19] = '選項';
$lang['zh'][20] = '整理選擇符(請謹慎使用)';
$lang['zh'][21] = '整理屬性';
$lang['zh'][22] = '重組選擇符';
$lang['zh'][23] = '速記法(shorthand)最佳化';
$lang['zh'][24] = '壓縮色彩語法';
$lang['zh'][25] = '改用小寫選擇符';
$lang['zh'][26] = '屬性的字形:';
$lang['zh'][27] = '小寫';
$lang['zh'][28] = '沒有輸入CSS, 語法不符合規定, 或是網址錯誤!';
$lang['zh'][29] = '大寫';
$lang['zh'][30] = 'XHTML必須使用小寫的元素名稱';
$lang['zh'][31] = '移除不必要的反斜線';
$lang['zh'][32] = '轉換 !important-hack';
$lang['zh'][33] = '輸出成檔案形式';
$lang['zh'][34] = '由於比較少換行字元, 會有更大的壓縮比率(複製&#38;貼上沒有用)';
$lang['zh'][35] = '執行';
$lang['zh'][36] = '壓縮比率';
$lang['zh'][37] = '輸入';
$lang['zh'][38] = '輸出';
$lang['zh'][39] = '語言';
$lang['zh'][41] = '注意: 這或許會變更你CSS原始碼的行為!';
$lang['zh'][42] = '除去最後一個分號';
$lang['zh'][43] = '拋棄不符合規定的屬性';
$lang['zh'][44] = '只安全地最佳化';
$lang['zh'][45] = '壓縮 font-weight';
$lang['zh'][46] = '保留註解';
$lang['zh'][47] = '什麼都不要改';
$lang['zh'][48] = '只分開原本用逗號分隔的選擇符';
$lang['zh'][49] = '合併有相同屬性的選擇符(快速)';
$lang['zh'][50] = '聰明地合併選擇符(慢速)';
$lang['zh'][51] = '保護CSS';
$lang['zh'][52] = '保留註解與 hack 等等. 如果啟用這個選項, 大多數的最佳化程序都不會執行.';
$lang['zh'][53] = '不改變';
$lang['zh'][54] = '不做最佳化';
$lang['zh'][55] = '安全地最佳化';
$lang['zh'][56] = '全部最佳化';
$lang['zh'][57] = '加上時間戳記';
$lang['zh'][58] = '复制到剪贴板';
$lang['zh'][59] = '回到页面上方';
$lang['zh'][60] = '你的浏览器不支持复制到剪贴板。';
$lang['zh'][61] = '如果程序有错误或你有建议,欢迎';
$lang['zh'][62] = '和我联系';
$lang['zh'][63] = 'Output CSS code as complete HTML document';
$lang['zh'][64] = '代码';
$lang['zh'][65] = 'CSS to style CSS output';
$lang['zh'][66] = 'You need to go to about:config in your URL bar, select \'signed.applets.codebase_principal_support\' in the filter field, and set its value to true in order to use this feature; however, be aware that doing so increases security risks.';

View File

@@ -0,0 +1,10 @@
| {
|| {
| | |;
|}|
|
}
| ||
|

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
/* */

View File

@@ -0,0 +1,261 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
/* NOAUTORTL */
.rtl .CodeMirror {
direction: rtl; /* code should always be written left to right */
}
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 400px;
}
.CodeMirror-scroll {
/* Set scrolling behavior here */
overflow: auto;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
background-color: white; /* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
border-left: 1px solid #ddd;
background-color: #f7f7f7;
white-space: nowrap;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
padding: 0 5px 0 3px;
min-width: 20px;
text-align: left;
color: #999;
}
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
border-right: 1px solid black;
z-index: 3;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-right: 1px solid silver;
}
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
z-index: 1;
}
/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
.cm-tab { display: inline-block; }
/* DEFAULT THEME */
.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable {color: black;}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3 {color: #085;}
.cm-s-default .cm-property {color: black;}
.cm-s-default .cm-operator {color: black;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-error {color: #f00;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-invalidchar {color: #f00;}
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-activeline-background {background: #e8f2ff;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
line-height: 1;
position: relative;
overflow: hidden;
background: white;
color: black;
}
.CodeMirror-scroll {
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px; margin-left: -30px;
padding-bottom: 30px; padding-left: 30px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
left: 0; top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0; right: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
left: 0; bottom: 0;
}
.CodeMirror-gutter-filler {
right: 0; bottom: 0;
}
.CodeMirror-gutters {
position: absolute; right: 0; top: 0;
padding-bottom: 30px;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
padding-bottom: 30px;
margin-bottom: -32px;
display: inline-block;
/* Hack to make IE7 behave */
*zoom:1;
*display:inline;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-lines {
cursor: text;
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */ border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-code pre {
border-left: 30px solid transparent;
width: -webkit-fit-content;
width: fit-content;
}
.CodeMirror-wrap .CodeMirror-code pre {
border-left: none;
width: auto;
}
.CodeMirror-linebackground {
position: absolute;
right: 0; left: 0; top: 0; bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-widget {
}
.CodeMirror-wrap .CodeMirror-scroll {
overflow-x: hidden;
}
.CodeMirror-measure {
position: absolute;
width: 100%; height: 0px;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor {
position: absolute;
visibility: hidden;
border-left: none;
width: 0;
}
.CodeMirror-focused div.CodeMirror-cursor {
visibility: visible;
}
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, .4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span { *vertical-align: text-bottom; }
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursor {
visibility: hidden;
}
}

View File

@@ -0,0 +1 @@
.rtl .CodeMirror{direction:rtl}.CodeMirror{font-family:monospace;height:400px}.CodeMirror-scroll{overflow:auto}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-left:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 5px 0 3px;min-width:20px;text-align:left;color:#999}.CodeMirror div.CodeMirror-cursor{border-right:1px solid #000;z-index:3}.CodeMirror div.CodeMirror-secondarycursor{border-right:1px solid silver}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7;z-index:1}.cm-tab{display:inline-block}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable{color:#000}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-property{color:#000}.cm-s-default .cm-operator{color:#000}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-error{color:red}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-invalidchar{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:#fff;color:#000}.CodeMirror-scroll{margin-bottom:-30px;margin-left:-30px;padding-bottom:30px;padding-left:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{left:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;right:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{left:0;bottom:0}.CodeMirror-gutter-filler{right:0;bottom:0}.CodeMirror-gutters{position:absolute;right:0;top:0;padding-bottom:30px;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;padding-bottom:30px;margin-bottom:-32px;display:inline-block}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text}.CodeMirror pre{border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-code pre{border-left:30px solid transparent;width:-webkit-fit-content;width:fit-content}.CodeMirror-wrap .CodeMirror-code pre{border-left:none;width:auto}.CodeMirror-linebackground{position:absolute;right:0;left:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;visibility:hidden;border-left:none;width:0}.CodeMirror-focused div.CodeMirror-cursor{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}@media print{.CodeMirror div.CodeMirror-cursor{visibility:hidden}}

View File

@@ -0,0 +1,262 @@
/* NOAUTORTL */
.rtl .CodeMirror {
direction: ltr; /* code should always be written left to right */
}
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 400px;
}
.CodeMirror-scroll {
/* Set scrolling behavior here */
overflow: auto;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
background-color: white; /* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
border-right: 1px solid #ddd;
background-color: #f7f7f7;
white-space: nowrap;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
}
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
border-left: 1px solid black;
z-index: 3;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
z-index: 1;
}
/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
.cm-tab { display: inline-block; }
/* DEFAULT THEME */
.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable {color: black;}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3 {color: #085;}
.cm-s-default .cm-property {color: black;}
.cm-s-default .cm-operator {color: black;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-error {color: #f00;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-invalidchar {color: #f00;}
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-activeline-background {background: #e8f2ff;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
line-height: 1;
position: relative;
overflow: hidden;
background: white;
color: black;
}
.CodeMirror-scroll {
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px; margin-right: -30px;
padding-bottom: 30px; padding-right: 30px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0; top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0; left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0; bottom: 0;
}
.CodeMirror-gutter-filler {
left: 0; bottom: 0;
}
.CodeMirror-gutters {
position: absolute; left: 0; top: 0;
padding-bottom: 30px;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
padding-bottom: 30px;
margin-bottom: -32px;
display: inline-block;
/* Hack to make IE7 behave */
*zoom:1;
*display:inline;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-lines {
cursor: text;
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-code pre {
border-right: 30px solid transparent;
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
}
.CodeMirror-wrap .CodeMirror-code pre {
border-right: none;
width: auto;
}
.CodeMirror-linebackground {
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-widget {
}
.CodeMirror-wrap .CodeMirror-scroll {
overflow-x: hidden;
}
.CodeMirror-measure {
position: absolute;
width: 100%; height: 0px;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor {
position: absolute;
visibility: hidden;
border-right: none;
width: 0;
}
.CodeMirror-focused div.CodeMirror-cursor {
visibility: visible;
}
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, .4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span { *vertical-align: text-bottom; }
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursor {
visibility: hidden;
}
}

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
.rtl .CodeMirror{direction:ltr}.CodeMirror{font-family:monospace;height:400px}.CodeMirror-scroll{overflow:auto}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000;z-index:3}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7;z-index:1}.cm-tab{display:inline-block}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable{color:#000}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-property{color:#000}.cm-s-default .cm-operator{color:#000}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-error{color:red}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-invalidchar{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:#fff;color:#000}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;padding-right:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;padding-bottom:30px;margin-bottom:-32px;display:inline-block}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text}.CodeMirror pre{border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-code pre{border-right:30px solid transparent;width:-webkit-fit-content;width:fit-content}.CodeMirror-wrap .CodeMirror-code pre{border-right:none;width:auto}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;visibility:hidden;border-right:none;width:0}.CodeMirror-focused div.CodeMirror-cursor{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}@media print{.CodeMirror div.CodeMirror-cursor{visibility:hidden}}

View File

@@ -0,0 +1,33 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
#revision-field-post_title, #revision-field-post_excerpt {
display: none;
}
#safecssform {
position: relative;
}
#poststuff {
padding-top: 0;
}
#safecss {
min-height: 250px;
width: 100%;
}
.misc-pub-section > span {
font-weight: bold;
}
.misc-pub-section > div {
margin-top: 3px;
}
#safecss-ace .ace_gutter {
z-index: 1;
}
#post-body-content{
margin-bottom: 20px;
}

View File

@@ -0,0 +1 @@
#revision-field-post_excerpt,#revision-field-post_title{display:none}#safecssform{position:relative}#poststuff{padding-top:0}#safecss{min-height:250px;width:100%}.misc-pub-section>span{font-weight:700}.misc-pub-section>div{margin-top:3px}#safecss-ace .ace_gutter{z-index:1}#post-body-content{margin-bottom:20px}

View File

@@ -0,0 +1,32 @@
#revision-field-post_title, #revision-field-post_excerpt {
display: none;
}
#safecssform {
position: relative;
}
#poststuff {
padding-top: 0;
}
#safecss {
min-height: 250px;
width: 100%;
}
.misc-pub-section > span {
font-weight: bold;
}
.misc-pub-section > div {
margin-top: 3px;
}
#safecss-ace .ace_gutter {
z-index: 1;
}
#post-body-content{
margin-bottom: 20px;
}

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
#revision-field-post_excerpt,#revision-field-post_title{display:none}#safecssform{position:relative}#poststuff{padding-top:0}#safecss{min-height:250px;width:100%}.misc-pub-section>span{font-weight:700}.misc-pub-section>div{margin-top:3px}#safecss-ace .ace_gutter{z-index:1}#post-body-content{margin-bottom:20px}

View File

@@ -0,0 +1,145 @@
/* NOAUTORTL */
.for-codemirror, .CodeMirror {
font-family: Consolas, Monaco, monospace;
font-size: 12px;
line-height: 16px;
margin: 0;
direction: ltr;
text-align: left;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
#customize-control-custom_css#customize-control-custom_css {
margin-right: -12px;
margin-left: -12px;
width: calc( 100% + 24px );
}
.customize-control-code_editor .CodeMirror {
height: 300px;
height: calc( 100vh - 268px );
}
.for-codemirror {
width: 98%;
height: 300px;
}
#customize-control-wpcom_custom_css_content_width_control {
position: relative;
}
#customize-control-wpcom_custom_css_content_width_control > label {
position: relative;
width: 100px;
}
#customize-control-wpcom_custom_css_content_width_control .customize-control-title {
padding-bottom: 6px;
}
#customize-controls #customize-control-wpcom_custom_css_content_width_control input[type="text"], /* stronger selector to override new-customizer.css */
#customize-control-wpcom_custom_css_content_width_control input[type="text"] {
width: 64px;
padding-right: 22px;
text-align: right;
}
#customize-control-wpcom_custom_css_content_width_control input[type="text"] + span {
position: absolute;
left: 43px;
padding-top: 3px;
opacity: .8;
}
#customize-control-wpcom_custom_css_content_width_control input[type="text"]:focus + span {
opacity: 1;
}
#customize-control-wpcom_custom_css_content_width_control .description {
display: block;
margin: 28px 0 0 0;
color: #aaa;
}
#customize-control-wpcom_custom_css_content_width_control .description strong {
font-style: normal;
}
#customize-control-jetpack_custom_css_control {
position: relative;
}
.css-help {
border-bottom: 1px solid #ddd;
background: #ffffff;
position: relative;
right: 0;
left: 0;
width: 100%;
padding: 0;
overflow: hidden;
}
.css-help a {
float: none;
display: inline-block;
text-decoration: none;
border-bottom: 4px solid transparent;
color: #555d66;
padding: 7px 10px 5px;
transition: .15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out;
}
.css-help a:hover {
color: #0073aa;
background-color: #f3f3f5;
}
.css-help a:before {
display: inline-block;
position: relative;
font-family: dashicons;
font-size: 20px;
padding-right: 3px;
top: 5px;
line-height: 1px;
}
.css-help a:focus {
color: #0073aa;
background-color: #f3f3f5;
border-bottom-color: #0073aa;
box-shadow: none;
}
.css-help a#revisions-link:before {
content: "\f321";
}
.css-help a#help-link:before {
content: "\f223";
}
#sub-accordion-section-custom_css .customize-control {
margin: 12px 0;
}
#sub-accordion-section-custom_css .customize-control-jetpackCss {
margin: 0 -12px;
width: calc( 100% + 24px );
}
#customize-theme-controls #sub-accordion-section-custom_css .customize-control-title {
margin-left: 0;
margin-right: 0;
}
#sub-accordion-section-custom_css #customize-control-jetpack_css_preprocessors_control select {
max-width: 75%;
}
body.editing-css .wp-full-overlay-sidebar {
width: 500px;
}
body.editing-css .wp-full-overlay.expanded {
margin-left: 500px;
}
input[type=jetpackCss] {
display: none;
}

View File

@@ -0,0 +1,260 @@
/* This file was automatically generated on Sep 10 2013 23:18:59 */
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
}
.CodeMirror-scroll {
/* Set scrolling behavior here */
overflow: auto;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
background-color: white; /* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
border-left: 1px solid #ddd;
background-color: #f7f7f7;
white-space: nowrap;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
padding: 0 5px 0 3px;
min-width: 20px;
text-align: left;
color: #999;
}
/* CURSOR */
.CodeMirror div.CodeMirror-cursor {
border-right: 1px solid black;
z-index: 3;
}
/* Shown when moving in bi-directional text */
.CodeMirror div.CodeMirror-secondarycursor {
border-right: 1px solid silver;
}
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
width: auto;
border: 0;
background: #7e7;
z-index: 1;
}
/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
.cm-tab { display: inline-block; }
/* DEFAULT THEME */
.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable {color: black;}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3 {color: #085;}
.cm-s-default .cm-property {color: black;}
.cm-s-default .cm-operator {color: black;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-error {color: #f00;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-link {text-decoration: underline;}
.cm-invalidchar {color: #f00;}
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
.CodeMirror-activeline-background {background: #e8f2ff;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
line-height: 1;
position: relative;
overflow: hidden;
background: white;
color: black;
}
.CodeMirror-scroll {
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror */
margin-bottom: -30px; margin-left: -30px;
padding-bottom: 30px; padding-left: 30px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
left: 0; top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0; right: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
left: 0; bottom: 0;
}
.CodeMirror-gutter-filler {
right: 0; bottom: 0;
}
.CodeMirror-gutters {
position: absolute; right: 0; top: 0;
padding-bottom: 30px;
z-index: 3;
}
.CodeMirror-gutter {
white-space: normal;
height: 100%;
padding-bottom: 30px;
margin-bottom: -32px;
display: inline-block;
/* Hack to make IE7 behave */
*zoom:1;
*display:inline;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-lines {
cursor: text;
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-code pre {
border-left: 30px solid transparent;
width: -webkit-fit-content;
width: -moz-fit-content;
width: fit-content;
}
.CodeMirror-wrap .CodeMirror-code pre {
border-left: none;
width: auto;
}
.CodeMirror-linebackground {
position: absolute;
right: 0; left: 0; top: 0; bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
overflow: auto;
}
.CodeMirror-widget {
}
.CodeMirror-wrap .CodeMirror-scroll {
overflow-x: hidden;
}
.CodeMirror-measure {
position: absolute;
width: 100%; height: 0px;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor {
position: absolute;
visibility: hidden;
border-left: none;
width: 0;
}
.CodeMirror-focused div.CodeMirror-cursor {
visibility: visible;
}
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.cm-searching {
background: #ffa;
background: rgba(255, 255, 0, .4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span { *vertical-align: text-bottom; }
@media print {
/* Hide the cursor when printing */
.CodeMirror div.CodeMirror-cursor {
visibility: hidden;
}
}

View File

@@ -0,0 +1,7 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
.CodeMirror, #safecss {
font-family: Consolas, Monaco, monospace;
font-size: 12px;
line-height: 16px;
min-height: 300px;
}

View File

@@ -0,0 +1 @@
#safecss,.CodeMirror{font-family:Consolas,Monaco,monospace;font-size:12px;line-height:16px;min-height:300px}

View File

@@ -0,0 +1,6 @@
.CodeMirror, #safecss {
font-family: Consolas, Monaco, monospace;
font-size: 12px;
line-height: 16px;
min-height: 300px;
}

View File

@@ -0,0 +1,2 @@
/* Do not modify this file directly. It is concatenated from individual module CSS files. */
#safecss,.CodeMirror{font-family:Consolas,Monaco,monospace;font-size:12px;line-height:16px;min-height:300px}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,42 @@
// Originally based on https://raw.githubusercontent.com/xwp/wp-custom-scss-demo/master/custom-scss-demo-preview.js
/* globals jpCustomizerCssPreview */
(function( api, $ ) {
if ( api.settingPreviewHandlers ) {
// No-op the custom_css preview handler since now handled by partial.
api.settingPreviewHandlers.custom_css = function() {};
} else {
parent.console.warn( 'Missing core patch that adds support for settingPreviewHandlers' );
}
api.selectiveRefresh.partialConstructor.custom_css = api.selectiveRefresh.Partial.extend( {
/**
* Refresh custom_css partial, using selective refresh if pre-processor and direct DOM manipulation if otherwise.
*
* @returns {jQuery.promise}
*/
refresh: function() {
var partial = this,
preprocessor = api( 'jetpack_custom_css[preprocessor]' ).get(),
deferred, setting;
// Sass or Less require Partial -- so ajax call to get it from PHP.
// We can explicitly override for specific providers by testing if `'sass' === preprocessor`
if ( jpCustomizerCssPreview.preprocessors.hasOwnProperty( preprocessor ) ) {
return api.selectiveRefresh.Partial.prototype.refresh.call( partial );
}
// No special providers, just write what we got.
deferred = new $.Deferred();
setting = api( 'custom_css[' + api.settings.theme.stylesheet + ']' );
_.each( partial.placements(), function( placement ) {
placement.container.text( setting.get() );
} );
deferred.resolve();
return deferred.promise();
}
} );
}( wp.customize, jQuery ));

View File

@@ -0,0 +1,85 @@
(function( $, customize ){
/**
* Helper function to qet a control by ID
* @param {string} controlId Control ID
* @return {object} jQuery object of the container
*/
function _getControl ( controlId ) {
var control = customize.control.value( controlId );
if ( control ) {
return control.container;
}
return null;
}
/**
* Add some labels that the default checkbox controls don't allow.
* Add CSS Revisions and CSS Help links.
*/
$(document).ready( function(){
var cssModeControl = _getControl( 'jetpack_css_mode_control' );
if ( cssModeControl ) {
cssModeControl.prepend( '<span class="customize-control-title">' + window._jp_css_settings.l10n.mode + '</span>' );
}
var mobileCssControl = _getControl( 'jetpack_mobile_css_control' );
if ( mobileCssControl ) {
mobileCssControl.prepend( '<span class="customize-control-title">' + window._jp_css_settings.l10n.mobile + '</span>' );
}
var widthControl = _getControl( 'wpcom_custom_css_content_width_control' );
if ( widthControl ) {
widthControl.append( '<span class="description">' + window._jp_css_settings.l10n.contentWidth + '<span>' );
widthControl.find( 'input' ).after( '<span>px</span>' );
}
$( '<div />', {
id : 'css-help-links',
'class' : 'css-help'
}).appendTo( _getControl( 'custom_css' ) );
$( '<a />', {
id : 'help-link',
target : '_blank',
rel: 'noopener noreferrer',
href : window._jp_css_settings.cssHelpUrl,
text : window._jp_css_settings.l10n.css_help_title
}).prependTo( '#css-help-links' );
// Only show the revisions link if there are revisions
if ( window._jp_css_settings.areThereCssRevisions ) {
$( '<a />', {
id : 'revisions-link',
target : '_blank',
rel: 'noopener noreferrer',
href : window._jp_css_settings.revisionsUrl,
text : window._jp_css_settings.l10n.revisions
}).prependTo( '#css-help-links' );
}
customize( 'jetpack_custom_css[preprocessor]', function( preprocessorSetting ) {
preprocessorSetting.bind( function( curr ) {
var preprocessor_modes = {
'default' : 'text/css',
less : 'text/x-less',
sass : 'text/x-scss'
},
new_mode = 'text/css';
if ( 'undefined' !== typeof preprocessor_modes[ curr ] ) {
new_mode = preprocessor_modes[ curr ];
}
customize.control( 'custom_css' ).deferred.codemirror.done( function ( cm ) {
cm.setOption( 'mode', new_mode );
if ( 'text/css' === new_mode ) {
cm.setOption( 'lint', true );
} else {
cm.setOption( 'lint', false );
}
});
});
});
});
})( jQuery, this.wp.customize );

View File

@@ -0,0 +1,192 @@
(function( wp, $, api ){
api.controlConstructor.jetpackCss = api.Control.extend({
modes: {
'default': 'text/css',
'less': 'text/x-less',
'sass': 'text/x-scss'
},
_updating: false,
/**
* Fires when our control is ready for action. Gets everything set up.
* @return {null}
*/
ready: function() {
this.opts = window._jp_css_settings;
// add our textarea
this.$input = $( '<textarea />', {
name: this.setting.id,
'class': 'for-codemirror hidden'
} ).val( this.setting() );
this.container.append( this.$input );
// keep the textarea and the setting synced up
api( this.setting.id, _.bind( function( setting ){
var element = new api.Element( this.$input );
this.elements = [ element ];
element.sync( setting );
element.set( setting() );
}, this ) );
// should we use CodeMirror?
if ( this.opts.useRichEditor ) {
this.initCodeMirror();
} else {
this.$input.removeClass( 'hidden' );
}
api.bind( 'ready', _.bind( this.addLabels, this ) );
},
/**
* Set up our CodeMirror instance
* @return {null}
*/
initCodeMirror: function() {
this.editor = window.CodeMirror.fromTextArea( this.$input.get(0), {
mode: this.getMode(),
lineNumbers: true,
tabSize: 2,
indentWithTabs: true,
lineWrapping: true
} );
this.addListeners();
},
/**
* Adds various listeners for CodeMirror to render and keep in sync
* with the textarea.
*/
addListeners: function() {
var edited = false;
// refresh the CodeMirror instance's rendering because it's initially hidden
// 250ms because that's the open animation duration
$( '#accordion-section-custom_css > .accordion-section-title' ).click( _.bind( _.debounce( this.editor.refresh, 250 ), this.editor ) );
// also refresh when focusing
this.editor.on( 'focus', function( editor ) {
editor.refresh();
});
// when the CodeMirror instance changes, mirror to the textarea,
// where we have our "true" change event handler bound. This allows both to function.
this.editor.on( 'change', _.bind( function( editor ) {
this._updating = true;
this.$input.val( editor.getValue() ).trigger( 'change' );
this._updating = false;
if ( ! edited ) {
window.ga && window.ga( 'send', 'event', 'Customizer', 'Typed Custom CSS' );
edited = true;
}
}, this ) );
this.editor.on( 'focus', function() {
window.ga && window.ga( 'send', 'event', 'Customizer', 'Focused CSS Editor' );
} );
// when others update the control, update CodeMirror
this.setting.bind( 'change', _.bind( this.externalChange, this ) );
},
/**
* Get the mode of the currently active preprocessor (if any),
* falling back to text/css
* @return {string} mode for CodeMirror
*/
getMode: function() {
var mode = api( 'jetpack_custom_css[preprocessor]' )();
if ( '' === mode || ! this.modes[ mode ] ) {
mode = 'default';
}
return this.modes[ mode ];
},
/**
* If another control updates our setting, re-render the CodeMirror instance
* @return {null}
*/
externalChange: function() {
// only if the change wasn't internal
if( ! this._updating ) {
this.editor.setValue( this.setting() );
}
},
/**
* Callback for when the CSS panel opens to refresh the CodeMirror rendering
* @param {string} id The panel being opened
* @return {null}
*/
refresh: function( id ) {
if ( 'accordion-section-custom_css' === id ) {
setTimeout( _.bind( function(){
this.editor.refresh();
}, this), 300 );
}
},
/**
* Add some labels that the default checkbox controls don't allow.
* Add CSS Revisions and CSS Help links.
*/
addLabels: function() {
this.addTitle( 'jetpack_css_mode_control', this.opts.l10n.mode );
this.addTitle( 'jetpack_mobile_css_control', this.opts.l10n.mobile );
this.addDesc( 'wpcom_custom_css_content_width_control', this.opts.l10n.contentWidth );
var widthControl = this._getControl( 'wpcom_custom_css_content_width_control' );
if ( widthControl ) {
widthControl.find( 'input' ).after( '<span>px</span>' );
}
$( '<div />', {
id: 'css-help-links',
'class': 'css-help'
}).appendTo( this.container );
$( '<a />', {
id: 'help-link',
target: '_blank',
href: this.opts.cssHelpUrl,
text: this.opts.l10n.css_help_title
}).prependTo( '#css-help-links' );
// Only show the revisions link if there are revisions
if ( this.opts.areThereCssRevisions ) {
$( '<a />', {
id: 'revisions-link',
target: '_blank',
href: this.opts.revisionsUrl,
text: this.opts.l10n.revisions
}).prependTo( '#css-help-links' );
}
},
/**
* Add a title to a control
* @param {string} controlId Control ID
* @param {string} title A title to add
*/
addTitle: function( controlId, title ) {
var control = this._getControl( controlId );
if ( control ) {
control.prepend( '<span class="customize-control-title">' + title + '<span>' );
}
},
/**
* Add a description to a control
* @param {string} controlId Control ID
* @param {string} desc A description to add
*/
addDesc: function( controlId, desc ) {
var control = this._getControl( controlId );
if ( control ) {
control.append( '<span class="description">' + desc + '<span>' );
}
},
/**
* Helper function to qet a control by ID
* @param {string} controlId Control ID
* @return {object} jQuery object of the container
*/
_getControl: function( controlId ) {
var control = api.control.value( controlId );
if ( control ) {
return control.container;
}
return null;
}
});
})( this.wp, jQuery, this.wp.customize );

View File

@@ -0,0 +1,91 @@
/* jshint onevar: false, smarttabs: true */
/* global postboxes, addLoadEvent */
( function( $ ) {
var safe, win, safecssResize, safecssInit;
safecssResize = function() {
safe.height( win.height() - safe.offset().top - 250 );
};
safecssInit = function() {
safe = $( '#safecss' );
win = $( window );
postboxes.add_postbox_toggles( 'editcss' );
safecssResize();
// Bound on a parent to ensure that this click event executes last.
$( '#safecssform' ).on( 'click', '#preview', function( e ) {
e.preventDefault();
document.forms.safecssform.target = 'csspreview';
document.forms.safecssform.action.value = 'preview';
document.forms.safecssform.submit();
document.forms.safecssform.target = '';
document.forms.safecssform.action.value = 'save';
} );
};
window.onresize = safecssResize;
addLoadEvent( safecssInit );
} )( jQuery );
jQuery( function( $ ) {
$( '.edit-preprocessor' ).bind( 'click', function( e ) {
e.preventDefault();
$( '#preprocessor-select' ).slideDown();
$( this ).hide();
} );
$( '.cancel-preprocessor' ).bind( 'click', function( e ) {
e.preventDefault();
$( '#preprocessor-select' ).slideUp( function() {
$( '.edit-preprocessor' ).show();
$( '#preprocessor_choices' ).val( $( '#custom_css_preprocessor' ).val() );
} );
} );
$( '.save-preprocessor' ).bind( 'click', function( e ) {
e.preventDefault();
$( '#preprocessor-select' ).slideUp();
$( '#preprocessor-display' ).text( $( '#preprocessor_choices option:selected' ).text() );
$( '#custom_css_preprocessor' )
.val( $( '#preprocessor_choices' ).val() )
.change();
$( '.edit-preprocessor' ).show();
} );
$( '.edit-css-mode' ).bind( 'click', function( e ) {
e.preventDefault();
$( '#css-mode-select' ).slideDown();
$( this ).hide();
} );
$( '.cancel-css-mode' ).bind( 'click', function( e ) {
e.preventDefault();
$( '#css-mode-select' ).slideUp( function() {
$( '.edit-css-mode' ).show();
$( 'input[name=add_to_existing_display][value=' + $( '#add_to_existing' ).val() + ']' ).attr(
'checked',
true
);
} );
} );
$( '.save-css-mode' ).bind( 'click', function( e ) {
e.preventDefault();
$( '#css-mode-select' ).slideUp();
$( '#css-mode-display' ).text(
$( 'input[name=add_to_existing_display]:checked' ).val() === 'true' ? 'Add-on' : 'Replacement'
);
$( '#add_to_existing' ).val( $( 'input[name=add_to_existing_display]:checked' ).val() );
$( '.edit-css-mode' ).show();
} );
} );

View File

@@ -0,0 +1,52 @@
/* jshint onevar: false, smarttabs: true */
( function( $ ) {
var Jetpack_CSS = {
modes: {
default: 'text/css',
less: 'text/x-less',
sass: 'text/x-scss',
},
init: function() {
this.$textarea = $( '#safecss' );
this.editor = window.CodeMirror.fromTextArea( this.$textarea.get( 0 ), {
mode: this.getMode(),
lineNumbers: true,
tabSize: 2,
indentWithTabs: true,
lineWrapping: true,
} );
this.setEditorHeight();
},
addListeners: function() {
// nice sizing
$( window ).on( 'resize', _.bind( _.debounce( this.setEditorHeight, 100 ), this ) );
// keep textarea synced up
this.editor.on(
'change',
_.bind( function( editor ) {
this.$textarea.val( editor.getValue() );
}, this )
);
// change mode
$( '#preprocessor_choices' ).change(
_.bind( function() {
this.editor.setOption( 'mode', this.getMode() );
}, this )
);
},
setEditorHeight: function() {
var height = $( 'html' ).height() - $( this.editor.getWrapperElement() ).offset().top;
this.editor.setSize( null, height );
},
getMode: function() {
var mode = $( '#preprocessor_choices' ).val();
if ( '' === mode || ! this.modes[ mode ] ) {
mode = 'default';
}
return this.modes[ mode ];
},
};
$( document ).ready( _.bind( Jetpack_CSS.init, Jetpack_CSS ) );
} )( jQuery );

View File

@@ -0,0 +1,58 @@
<?php
/**
* CSS preprocessor registration.
*
* To add a new preprocessor (or replace an existing one), hook into the
* jetpack_custom_css_preprocessors filter and add an entry to the array
* that is passed in.
*
* Format is:
* $preprocessors[ UNIQUE_KEY ] => array( 'name' => 'Processor name', 'callback' => [processing function] );
*
* The callback function accepts a single string argument (non-CSS markup) and returns a string (CSS).
*
* @param array $preprocessors The list of preprocessors added thus far.
* @return array
*/
function jetpack_register_css_preprocessors( $preprocessors ) {
$preprocessors['less'] = array(
'name' => 'LESS',
'callback' => 'jetpack_less_css_preprocess'
);
$preprocessors['sass'] = array(
'name' => 'Sass (SCSS Syntax)',
'callback' => 'jetpack_sass_css_preprocess'
);
return $preprocessors;
}
add_filter( 'jetpack_custom_css_preprocessors', 'jetpack_register_css_preprocessors' );
function jetpack_less_css_preprocess( $less ) {
require_once( dirname( __FILE__ ) . '/preprocessors/lessc.inc.php' );
$compiler = new lessc();
try {
return $compiler->compile( $less );
} catch ( Exception $e ) {
return $less;
}
}
function jetpack_sass_css_preprocess( $sass ) {
require_once( dirname( __FILE__ ) . '/preprocessors/scss.inc.php' );
$compiler = new scssc();
$compiler->setFormatter( 'scss_formatter' );
try {
return $compiler->compile( $sass );
} catch ( Exception $e ) {
return $sass;
}
}

View File

@@ -0,0 +1,243 @@
<?php
/**
* Migration from Jetpack Custom CSS to WordPress' Core CSS.
*
* @since 4.4.2
*
* @package Jetpack
*/
/**
* Class Jetpack_Custom_CSS_Data_Migration
*/
class Jetpack_Custom_CSS_Data_Migration {
/**
* Set up assorted actions and filters used by this class.
*/
public static function add_hooks() {
add_action( 'init', array( __CLASS__, 'register_legacy_post_type' ) );
add_action( 'admin_init', array( __CLASS__, 'do_migration' ) );
include_once( dirname( __FILE__ ) . '/custom-css.php' );
if ( ! is_admin() ) {
add_action( 'init', array( 'Jetpack_Custom_CSS', 'init' ) );
}
}
/**
* Do the bulk of the migration.
*
* @return int|null
*/
public static function do_migration() {
Jetpack_Options::update_option( 'custom_css_4.7_migration', true );
Jetpack::log( 'custom_css_4.7_migration', 'start' );
if ( ! post_type_exists( 'safecss' ) ) {
self::register_legacy_post_type();
}
/** This filter is documented in modules/custom-css/custom-css.php */
$preprocessors = apply_filters( 'jetpack_custom_css_preprocessors', array() );
$core_css_post = wp_get_custom_css_post();
$jetpack_css_post = self::get_post();
if ( ! $jetpack_css_post ) {
return;
}
$revisions = self::get_all_revisions();
// Migrate the settings from revision meta to theme mod.
$options = self::get_options( $jetpack_css_post->ID );
set_theme_mod( 'jetpack_custom_css', $options );
if ( empty( $revisions ) || ! is_array( $revisions ) ) {
if ( $jetpack_css_post instanceof WP_Post ) {
// Feed in the raw, if the current setting is Sass/LESS, it'll filter it inside.
kses_remove_filters();
wp_update_custom_css_post( $jetpack_css_post->post_content );
kses_init();
return 1;
}
return null;
}
$revisions = array_reverse( $revisions );
$themes = Jetpack_Custom_CSS_Enhancements::get_themes();
$migrated = array();
foreach ( $revisions as $post_id => $post ) {
// Jetpack had stored the theme Name, not the stylesheet directory, for ... reasons.
// Get the stylesheet. If null, the theme is no longer available. Skip.
$stylesheet = isset( $themes[ $post->post_excerpt ] ) ? $themes[ $post->post_excerpt ] : null;
if ( empty( $stylesheet ) ) {
continue;
}
$migrated[] = $post->ID;
$preprocessor = get_post_meta( $post->ID, 'custom_css_preprocessor', true );
$css = $post->post_content;
$pre = '';
// Do a revision by revision parsing.
if ( $preprocessor && isset( $preprocessors[ $preprocessor ] ) ) {
$pre = $css;
$css = call_user_func( $preprocessors[ $preprocessor ]['callback'], $pre );
}
kses_remove_filters();
wp_update_custom_css_post( $css, array(
'stylesheet' => $stylesheet,
'preprocessed' => $pre,
) );
kses_init();
}
// If we've migrated some CSS for the current theme and there was already something there in the Core dataset ...
if ( $core_css_post && $jetpack_css_post ) {
$preprocessor = $options['preprocessor'];
$css = $core_css_post->post_content;
$pre = $core_css_post->post_content_filtered;
if ( $preprocessor ) {
if ( $pre ) {
$pre .= "\r\n\r\n/*\r\n\t" . esc_js( __( 'CSS Migrated from Jetpack:', 'jetpack' ) ) . "\r\n*/\r\n\r\n";
}
$pre .= $jetpack_css_post->post_content;
$css .= "\r\n\r\n/*\r\n\t" . esc_js( __( 'CSS Migrated from Jetpack:', 'jetpack' ) ) . "\r\n*/\r\n\r\n";
$css .= call_user_func( $preprocessors[ $preprocessor ]['callback'], $jetpack_css_post->post_content );
} else {
$css .= "\r\n\r\n/*\r\n\t" . esc_js( __( 'CSS Migrated from Jetpack:', 'jetpack' ) ) . "\r\n*/\r\n\r\n";
$css .= $jetpack_css_post->post_content;
}
wp_update_custom_css_post( $css, array(
'preprocessed' => $pre,
) );
}
Jetpack::log( 'custom_css_4.7_migration', count( $migrated ) . 'revisions migrated' );
return count( $migrated );
}
/**
* Re-register the legacy CPT so we can play with the content already in the database.
*/
public static function register_legacy_post_type() {
if ( post_type_exists( 'safecss' ) ) {
return;
}
// Register safecss as a custom post_type
// Explicit capability definitions are largely unnecessary because the posts are manipulated in code via an options page, managing CSS revisions does check the capabilities, so let's ensure that the proper caps are checked.
register_post_type( 'safecss', array(
'label' => 'Custom CSS',
'supports' => array( 'revisions' ),
'can_export' => false,
'rewrite' => false,
'capabilities' => array(
'edit_post' => 'edit_theme_options',
'read_post' => 'read',
'delete_post' => 'edit_theme_options',
'edit_posts' => 'edit_theme_options',
'edit_others_posts' => 'edit_theme_options',
'publish_posts' => 'edit_theme_options',
'read_private_posts' => 'read',
),
) );
}
/**
* Get the post used for legacy storage.
*
* Jetpack used to use a single post for all themes, just blanking it on theme switch. This gets that post.
*
* @return array|bool|null|WP_Post
*/
public static function get_post() {
/** This filter is documented in modules/custom-css/custom-css.php */
$custom_css_post_id = apply_filters( 'jetpack_custom_css_pre_post_id', null );
if ( ! is_null( $custom_css_post_id ) ) {
return get_post( $custom_css_post_id );
}
$custom_css_post_id = wp_cache_get( 'custom_css_post_id' );
if ( false === $custom_css_post_id ) {
$custom_css_posts = get_posts( array(
'posts_per_page' => 1,
'post_type' => 'safecss',
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',
) );
$custom_css_post_id = 0;
if ( count( $custom_css_posts ) > 0 ) {
$custom_css_post_id = $custom_css_posts[0]->ID;
}
// Save post_id=0 to note that no safecss post exists.
wp_cache_set( 'custom_css_post_id', $custom_css_post_id );
}
if ( ! $custom_css_post_id ) {
return false;
}
return get_post( $custom_css_post_id );
}
/**
* Get all revisions of the Jetpack CSS CPT entry.
*
* @return array
*/
public static function get_all_revisions() {
$post = self::get_post();
if ( ! $post ) {
return array();
}
$revisions = wp_get_post_revisions( $post->ID, array(
'posts_per_page' => -1,
'orderby' => 'date',
'order' => 'DESC',
) );
return $revisions;
}
/**
* Get the options stored for a given revision ID.
*
* Jetpack used to version the settings by storing them as meta on the revision.
*
* @param integer $post_id Post ID.
*
* @return array
*/
public static function get_options( $post_id = null ) {
if ( empty( $post_id ) ) {
$post = self::get_post();
$post_id = $post->ID;
}
$meta = get_post_meta( $post_id );
$replace = false;
if ( isset( $meta['custom_css_add'][0] ) && 'no' === $meta['custom_css_add'][0] ) {
$replace = true;
}
return array(
'preprocessor' => isset( $meta['custom_css_preprocessor'][0] ) ? $meta['custom_css_preprocessor'][0] : '',
'replace' => $replace,
'content_width' => isset( $meta['content_width'][0] ) ? $meta['content_width'][0] : '',
);
}
}
Jetpack_Custom_CSS_Data_Migration::add_hooks();