├── .gitignore ├── template-medium.txt ├── csstidyphp ├── .gitignore ├── Docs │ ├── media │ │ ├── empty.png │ │ ├── background.png │ │ └── style.css │ ├── errors.html │ ├── classtrees_csstidy.html │ ├── index.html │ ├── li_csstidy.html │ ├── todolist.html │ └── csstidy │ │ ├── _class_csstidy_print_php.html │ │ ├── _class_csstidy_optimise_php.html │ │ └── _class_csstidy_php.html ├── testing │ ├── unit-tests │ │ ├── _files.php │ │ ├── csst │ │ │ ├── selectors │ │ │ │ ├── type.csst │ │ │ │ ├── id.csst │ │ │ │ ├── universal.csst │ │ │ │ ├── class.csst │ │ │ │ ├── errors │ │ │ │ │ ├── duplicate-combinator.csst │ │ │ │ │ └── dangling-combinator.csst │ │ │ │ ├── adjacent.csst │ │ │ │ ├── child.csst │ │ │ │ ├── active.csst │ │ │ │ ├── attribute-set.csst │ │ │ │ ├── descendant.csst │ │ │ │ ├── focus.csst │ │ │ │ ├── grouping.csst │ │ │ │ ├── hover.csst │ │ │ │ ├── lang.csst │ │ │ │ ├── link.csst │ │ │ │ ├── combinator-compressed.csst │ │ │ │ ├── universal-shorthand.csst │ │ │ │ ├── visited.csst │ │ │ │ ├── first-child.csst │ │ │ │ ├── universal-optimization.csst │ │ │ │ ├── attribute-equals.csst │ │ │ │ ├── simple.csst │ │ │ │ ├── attribute-begins.csst │ │ │ │ ├── attribute-contains.csst │ │ │ │ ├── chain.csst │ │ │ │ ├── merge-optimization.csst │ │ │ │ ├── same-merge-siblings.csst │ │ │ │ ├── merge-preserve.csst │ │ │ │ ├── same-nomerge.csst │ │ │ │ └── pseudo-elements.csst │ │ │ ├── special │ │ │ │ ├── iezoom.csst │ │ │ │ ├── hex.csst │ │ │ │ ├── cursor.csst │ │ │ │ ├── font-face_woff.csst │ │ │ │ ├── ie-hacks-sort.csst │ │ │ │ ├── ie-hacks.csst │ │ │ │ ├── same-atmedia-merge.csst │ │ │ │ ├── font-face-simple.csst │ │ │ │ ├── atmedia-decimals.csst │ │ │ │ ├── same-atmedia-nomerge.csst │ │ │ │ ├── font-face-mini.csst │ │ │ │ ├── newlines.csst │ │ │ │ ├── complex-gradient.csst │ │ │ │ ├── font-face-atmedia.csst │ │ │ │ ├── font-face-atmedia-2.csst │ │ │ │ └── font-face.csst │ │ │ ├── values │ │ │ │ ├── number-float.csst │ │ │ │ ├── number-trailingzero.csst │ │ │ │ ├── number-zero.csst │ │ │ │ ├── number-missingzero.csst │ │ │ │ ├── number-signed.csst │ │ │ │ ├── number-leadingzero.csst │ │ │ │ ├── important.csst │ │ │ │ ├── number-missingunit.csst │ │ │ │ ├── colors.csst │ │ │ │ ├── font-family.csst │ │ │ │ └── quoted-strings.csst │ │ │ ├── shorthands │ │ │ │ ├── font-face.csst │ │ │ │ ├── font-weight-general.csst │ │ │ │ ├── font-weight-noopt.csst │ │ │ │ ├── margin-noopt.csst │ │ │ │ ├── background-general.csst │ │ │ │ ├── padding-noopt.csst │ │ │ │ ├── font-noopt.csst │ │ │ │ ├── font-general.csst │ │ │ │ ├── background-noopt.csst │ │ │ │ ├── bugshorthand1.csst │ │ │ │ ├── bugshorthand2.csst │ │ │ │ ├── margin-general.csst │ │ │ │ ├── padding-general.csst │ │ │ │ └── bugshorthand3.csst │ │ │ ├── README │ │ │ ├── print-plain │ │ │ │ ├── ie-hacks.csst │ │ │ │ ├── atvalues.csst │ │ │ │ ├── font-face-atmedia.csst │ │ │ │ ├── simple-highest.csst │ │ │ │ ├── simple-high.csst │ │ │ │ ├── simple-default.csst │ │ │ │ ├── simple-low.csst │ │ │ │ └── font-face-atmedia-2.csst │ │ │ ├── vendor-prefixed │ │ │ │ └── webkit-gradient.csst │ │ │ └── properties │ │ │ │ ├── preserve-merging.csst │ │ │ │ ├── multiple-properties.csst │ │ │ │ ├── importance.csst │ │ │ │ ├── css1.csst │ │ │ │ ├── css21.csst │ │ │ │ ├── css2.csst │ │ │ │ └── css3.csst │ │ ├── class.csstidy_reporter.php │ │ ├── class.csstidy_harness.php │ │ ├── test.csst.php │ │ ├── class.Text_Diff_Renderer_parallel.php │ │ └── class.csstidy_csst.php │ ├── unit-tests.inc │ └── unit-tests.php ├── template3.tpl ├── template2.tpl ├── template.tpl ├── template1.tpl ├── cssparsed.css ├── composer.json ├── .gitattributes ├── NEWS ├── class.csstidy_ctype.php ├── cssparse.css ├── README ├── class.csstidy_print.php └── lang.inc.php ├── win └── csstidy.exe ├── csstidy.sublime-commands ├── .gitattributes ├── Main.sublime-menu ├── csstidy.sublime-settings ├── README.md ├── csstidy.php ├── csstidy.py └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | *.tmp 2 | -------------------------------------------------------------------------------- /template-medium.txt: -------------------------------------------------------------------------------- 1 | 2 | | {|| { |||; |} 3 | ||}|| 4 | | 5 | | -------------------------------------------------------------------------------- /csstidyphp/.gitignore: -------------------------------------------------------------------------------- 1 | testing/simpletest* 2 | testing/Text* 3 | nbproject* 4 | -------------------------------------------------------------------------------- /win/csstidy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fitnr/SublimeCSSTidy/master/win/csstidy.exe -------------------------------------------------------------------------------- /csstidyphp/Docs/media/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fitnr/SublimeCSSTidy/master/csstidyphp/Docs/media/empty.png -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/_files.php: -------------------------------------------------------------------------------- 1 | 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/id.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | ID selector 3 | --CSS-- 4 | a#foo {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a#foo' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/universal.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Universal selector 3 | --CSS-- 4 | * {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | '*' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/iezoom.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | IE Zoom 3 | --CSS-- 4 | #content { 5 | zoom: 1; 6 | } 7 | --EXPECT-- 8 | array ( 9 | '#content' => 10 | array ( 11 | 'zoom' => '1', 12 | ), 13 | ) 14 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/class.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Class selector 3 | --CSS-- 4 | a.foo {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a.foo' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/errors/duplicate-combinator.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Duplicate combinator selector 3 | --CSS-- 4 | div + + b {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | ) 8 | --SETTINGS-- 9 | discard_invalid_selectors=1 -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/hex.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | --CSS-- 3 | li:before { content: "\00BB \0020"; } 4 | --EXPECT-- 5 | array ( 6 | 'li:before' => 7 | array ( 8 | 'content' => '"\\00BB \\0020"', 9 | ), 10 | ) 11 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/adjacent.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Adjacent selector 3 | --CSS-- 4 | a + b {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a + b' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/child.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Child selector 3 | --CSS-- 4 | table > tr {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'table > tr' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/active.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Dynamic active selector 3 | --CSS-- 4 | a:active {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a:active' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/attribute-set.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Attribute selector 3 | --CSS-- 4 | a[foo] {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a[foo]' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/descendant.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Descendant selector 3 | --CSS-- 4 | table tr {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'table tr' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/focus.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Dynamic focus selector 3 | --CSS-- 4 | a:focus {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a:focus' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/grouping.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Grouped selectors 3 | --CSS-- 4 | h1,h2,h3 {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'h1,h2,h3' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/hover.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Dynamic hover selector 3 | --CSS-- 4 | a:hover {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a:hover' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/lang.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Language selector 3 | --CSS-- 4 | div:lang(en) {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'div:lang(en)' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/link.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Not-visited link selector 3 | --CSS-- 4 | a:link {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a:link' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/combinator-compressed.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Combinator selector 3 | --CSS-- 4 | a>b {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a>b' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/universal-shorthand.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Universal selector shorthand 3 | --CSS-- 4 | .foo {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | '.foo' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/visited.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Visited link selector 3 | --CSS-- 4 | a:visited {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a:visited' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/number-float.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Floating point 3 | --CSS-- 4 | a { font-size:01.5010em } 5 | --EXPECT-- 6 | array ( 7 | 'a' => 8 | array ( 9 | 'font-size' => '1.501em', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/number-trailingzero.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Trailing zeros 3 | --CSS-- 4 | a { font-size:1.000em } 5 | --EXPECT-- 6 | array ( 7 | 'a' => 8 | array ( 9 | 'font-size' => '1em', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/first-child.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | First child selector 3 | --CSS-- 4 | p:first-child {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'p:first-child' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/universal-optimization.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Universal selector optimization 3 | --CSS-- 4 | *.foo {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | '.foo' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/attribute-equals.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Attribute equals selector 3 | --CSS-- 4 | a[foo="warning"] {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a[foo="warning"]' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/simple.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Simple selector 3 | --CSS-- 4 | a[foo="bar"].class#id:hover {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a[foo="bar"].class#id:hover' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/number-zero.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Zero 3 | --CSS-- 4 | a { font-size:0px; line-height:00.00 } 5 | --EXPECT-- 6 | array ( 7 | 'a' => 8 | array ( 9 | 'font-size' => '0', 10 | 'line-height' => '0', 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/attribute-begins.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Begins hyphen-separated attribute list selector 3 | --CSS-- 4 | a[foo|="en"] {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a[foo|="en"]' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/cursor.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | multiples cursor rules 3 | --CSS-- 4 | a { 5 | cursor: pointer; 6 | cursor: hand; 7 | } 8 | --EXPECT-- 9 | array ( 10 | 'a' => 11 | array ( 12 | 'cursor' => 'pointer', 13 | 'cursor ' => 'hand', 14 | ), 15 | ) 16 | -------------------------------------------------------------------------------- /csstidyphp/template3.tpl: -------------------------------------------------------------------------------- 1 | |{||{|||;|}||}|||| -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/attribute-contains.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Contained in space-separated attribute list selector 3 | --CSS-- 4 | a[foo~="warning"] {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a[foo~="warning"]' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/chain.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Chained selector 3 | --CSS-- 4 | a * > div[attr="value"].class + div#id:hover {display: inherit;} 5 | --EXPECT-- 6 | array ( 7 | 'a * > div[attr="value"].class + div#id:hover' => 8 | array ( 9 | 'display' => 'inherit', 10 | ), 11 | ) 12 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/number-missingzero.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Missing zero 3 | --CSS-- 4 | a { font-size:0.1em } 5 | b { font-size:.1em } 6 | --EXPECT-- 7 | array ( 8 | 'a,b' => 9 | array ( 10 | 'font-size' => '.1em', 11 | ), 12 | ) 13 | --SETTINGS-- 14 | merge_selectors=2 -------------------------------------------------------------------------------- /csstidyphp/template2.tpl: -------------------------------------------------------------------------------- 1 | | { 2 | ||{|||;|}| 3 | | 4 | } 5 | |||| 6 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/errors/dangling-combinator.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Dangling combinator selector 3 | --CSS-- 4 | + b {display: inherit;} 5 | b > {font-family: inherit;} 6 | asdf {font-size: inherit;} 7 | --EXPECT-- 8 | array ( 9 | ) 10 | --SETTINGS-- 11 | optimise_shorthands=0 12 | discard_invalid_selectors=1 -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/number-signed.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Signed 3 | --CSS-- 4 | a { font-size:-1em } 5 | b { font-size:+1em } 6 | --EXPECT-- 7 | array ( 8 | 'a' => 9 | array ( 10 | 'font-size' => '-1em', 11 | ), 12 | 'b' => 13 | array ( 14 | 'font-size' => '1em', 15 | ), 16 | ) 17 | -------------------------------------------------------------------------------- /csstidy.sublime-commands: -------------------------------------------------------------------------------- 1 | [ 2 | { "caption": "Tidy CSS", "command": "css_tidy" }, 3 | { "caption": "Tidy CSS (Highest Compression)", "command": "css_tidy", "args": {"template": "highest", "preserve_css": "true" } }, 4 | { "caption": "Tidy CSS (Low Compression)", "command": "css_tidy", "args": {"template": "low", "preserve_css": "true" } } 5 | 6 | ] 7 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/merge-optimization.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Merge selectors optimization 3 | --CSS-- 4 | h1 {display: inherit;} 5 | h2 {display: inherit;} 6 | h3 {display: inherit;} 7 | --EXPECT-- 8 | array ( 9 | 'h1,h2,h3' => 10 | array ( 11 | 'display' => 'inherit', 12 | ), 13 | ) 14 | --SETTINGS-- 15 | merge_selectors=2 -------------------------------------------------------------------------------- /csstidyphp/template.tpl: -------------------------------------------------------------------------------- 1 | | { 2 | || { 3 | |||; 4 | |}| 5 | 6 | | 7 | } 8 | 9 | ||| 10 | | 11 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/number-leadingzero.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Leading zeros 3 | --CSS-- 4 | a { font-size:0001em; foo:00.1em; line-height:00.1; bar:-00.1;} 5 | --EXPECT-- 6 | array ( 7 | 'a' => 8 | array ( 9 | 'font-size' => '1em', 10 | 'foo' => '.1em', 11 | 'line-height' => '.1', 12 | 'bar' => '-.1', 13 | ), 14 | ) 15 | -------------------------------------------------------------------------------- /csstidyphp/template1.tpl: -------------------------------------------------------------------------------- 1 | | { 2 | || 3 | { 4 | | ||; 5 | |}| 6 | 7 | | 8 | 9 | } 10 | 11 | | || 12 | | 13 | -------------------------------------------------------------------------------- /csstidyphp/cssparsed.css: -------------------------------------------------------------------------------- 1 | code#copytext { 2 | white-space:pre; 3 | font-family:Verdana 4 | } 5 | 6 | .at { 7 | color:#00008b 8 | } 9 | 10 | .format { 11 | color:gray 12 | } 13 | 14 | .property { 15 | color:green 16 | } 17 | 18 | .selector { 19 | color:blue 20 | } 21 | 22 | .value { 23 | color:red; 24 | left:500px 25 | } 26 | 27 | .comment { 28 | color:orange 29 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Standard to msysgit 5 | *.doc diff=astextplain 6 | *.DOC diff=astextplain 7 | *.docx diff=astextplain 8 | *.DOCX diff=astextplain 9 | *.dot diff=astextplain 10 | *.DOT diff=astextplain 11 | *.pdf diff=astextplain 12 | *.PDF diff=astextplain 13 | *.rtf diff=astextplain 14 | *.RTF diff=astextplain 15 | -------------------------------------------------------------------------------- /csstidyphp/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cerdic/css-tidy", 3 | "description": "CSSTidy is a CSS minifier", 4 | "license": "LGPL-2.1", 5 | "authors": [ 6 | { 7 | "name": "Cédric MORIN", 8 | "email": "changeme@mailinator.com" 9 | } 10 | ], 11 | "autoload" : { 12 | "classmap": ["."] 13 | }, 14 | "require": { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/font-face.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test font-face optimization (no optimization) 3 | --CSS-- 4 | @font-face { 5 | src: url("fonts/share.ttf") format("truetype"); 6 | } 7 | --FULLEXPECT-- 8 | array ( 9 | ' '=> array( 10 | '@font-face' => 11 | array ( 12 | 'src' => 'url(fonts/share.ttf) format("truetype")', 13 | ), 14 | ), 15 | ) 16 | --SETTINGS-- 17 | optimise_shorthands=0 -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/important.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests !important 3 | --CSS-- 4 | a { 5 | color:red !important; 6 | size:2 ! important; 7 | foo:2! important; 8 | bar:2!important; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'color' => 'red!important', 15 | 'size' => '2!important', 16 | 'foo' => '2!important', 17 | 'bar' => '2!important', 18 | ), 19 | ) 20 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/font-weight-general.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test font-weight optimization (full) 3 | --CSS-- 4 | a { 5 | font-weight: bold; 6 | } 7 | b { 8 | font-weight: normal; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'font-weight' => '700', 15 | ), 16 | 'b' => 17 | array ( 18 | 'font-weight' => '400', 19 | ), 20 | ) 21 | --SETTINGS-- 22 | compress_font-weight=true -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/font-weight-noopt.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test font-weight optimization (no optimization) 3 | --CSS-- 4 | a { 5 | font-weight: bold; 6 | } 7 | b { 8 | font-weight: normal; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'font-weight' => 'bold', 15 | ), 16 | 'b' => 17 | array ( 18 | 'font-weight' => 'normal', 19 | ), 20 | ) 21 | --SETTINGS-- 22 | compress_font-weight=false -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/number-missingunit.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Missing unit 3 | --CSS-- 4 | a { 5 | font-size:1.0; 6 | line-height:1.0; 7 | color:123456; 8 | font:1em/1.0 verdana; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'font-size' => '1px', 15 | 'line-height' => '1', 16 | 'color' => '#123456', 17 | 'font' => '1em/1 verdana', 18 | ), 19 | ) 20 | --SETTINGS-- 21 | optimise_shorthands=0 -------------------------------------------------------------------------------- /csstidyphp/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Standard to msysgit 5 | *.doc diff=astextplain 6 | *.DOC diff=astextplain 7 | *.docx diff=astextplain 8 | *.DOCX diff=astextplain 9 | *.dot diff=astextplain 10 | *.DOT diff=astextplain 11 | *.pdf diff=astextplain 12 | *.PDF diff=astextplain 13 | *.rtf diff=astextplain 14 | *.RTF diff=astextplain 15 | 16 | *.html -text 17 | *.css -text 18 | *.php -text 19 | *.csst -text -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/same-merge-siblings.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | merge multiples siblings occurences of same seletor 3 | --SETTINGS-- 4 | merge_selectors = 0 5 | --CSS-- 6 | h1,h2 {font-size:1em;} 7 | h1 {display: inherit;} 8 | h1 {font-size:2em;} 9 | --EXPECT-- 10 | array ( 11 | 'h1,h2' => 12 | array ( 13 | 'font-size' => '1em', 14 | ), 15 | 'h1' => 16 | array ( 17 | 'display' => 'inherit', 18 | 'font-size' => '2em', 19 | ), 20 | ) 21 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/margin-noopt.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test margin optimization 3 | --CSS-- 4 | a { 5 | margin-left: 10px; 6 | margin-right: 10px; 7 | margin-top: 10px; 8 | margin-bottom: 10px; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'margin-left' => '10px', 15 | 'margin-right' => '10px', 16 | 'margin-top' => '10px', 17 | 'margin-bottom' => '10px', 18 | ), 19 | ) 20 | --SETTINGS-- 21 | optimise_shorthands=0 -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/colors.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test color optimisation 3 | --CSS-- 4 | a { 5 | foo:rgb(0,0,0); 6 | bar:black; 7 | baz:#ffaabb; 8 | qux:#f00; 9 | quux:blanchedalmond; 10 | quuux:rgb(0,0,1); 11 | } 12 | --EXPECT-- 13 | array ( 14 | 'a' => 15 | array ( 16 | 'foo' => '#000', 17 | 'bar' => '#000', 18 | 'baz' => '#fab', 19 | 'qux' => 'red', 20 | 'quux' => '#ffebcd', 21 | 'quuux' => '#000001', 22 | ), 23 | ) 24 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/merge-preserve.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Merge selectors optimization off 3 | --SETTINGS-- 4 | merge_selectors = 0 5 | --CSS-- 6 | h1 {display: inherit;} 7 | h2 {display: inherit;} 8 | h3 {display: inherit;} 9 | --EXPECT-- 10 | array ( 11 | 'h1' => 12 | array ( 13 | 'display' => 'inherit', 14 | ), 15 | 'h2' => 16 | array ( 17 | 'display' => 'inherit', 18 | ), 19 | 'h3' => 20 | array ( 21 | 'display' => 'inherit', 22 | ), 23 | ) 24 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/background-general.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general background optimization 3 | --CSS-- 4 | a { 5 | background-color: white; 6 | background-image: url(123); 7 | background-repeat: no-repeat; 8 | background-position: 1px 1px; 9 | background-attachment: scroll; 10 | } 11 | --EXPECT-- 12 | array ( 13 | 'a' => 14 | array ( 15 | 'background' => 'url(123) no-repeat 1px 1px #fff', 16 | ), 17 | ) 18 | --SETTINGS-- 19 | optimise_shorthands=3 -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/same-nomerge.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Don't merge multiples occurences of same seletor 3 | --SETTINGS-- 4 | merge_selectors = 0 5 | --CSS-- 6 | h1 {display: inherit;} 7 | h1,h2 {font-size:1em;} 8 | h1 {font-size:2em;} 9 | --EXPECT-- 10 | array ( 11 | 'h1' => 12 | array ( 13 | 'display' => 'inherit', 14 | ), 15 | 'h1,h2' => 16 | array ( 17 | 'font-size' => '1em', 18 | ), 19 | 'h1 ' => 20 | array ( 21 | 'font-size' => '2em', 22 | ), 23 | ) 24 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/padding-noopt.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test padding optimization (no optimization) 3 | --CSS-- 4 | a { 5 | padding-left: 10px; 6 | padding-right: 10px; 7 | padding-top: 10px; 8 | padding-bottom: 10px; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'padding-left' => '10px', 15 | 'padding-right' => '10px', 16 | 'padding-top' => '10px', 17 | 'padding-bottom' => '10px', 18 | ), 19 | ) 20 | --SETTINGS-- 21 | optimise_shorthands=0 -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/font-noopt.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general font optimization (no optimization) 3 | --CSS-- 4 | a { 5 | font-weight: bold; 6 | font-size: 12px; 7 | line-height: 2em; 8 | font-family: Arial, sans-serif; 9 | } 10 | --EXPECT-- 11 | array ( 12 | 'a' => 13 | array ( 14 | 'font-weight' => '700', 15 | 'font-size' => '12px', 16 | 'line-height' => '2em', 17 | 'font-family' => 'Arial,sans-serif', 18 | ), 19 | ) 20 | --SETTINGS-- 21 | optimise_shorthands=0 -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/class.csstidy_reporter.php: -------------------------------------------------------------------------------- 1 | array( 11 | '@font-face' => 12 | array ( 13 | 'font-family' => '"Unibody8SmallCaps Regular"', 14 | 'src' => 'url(fonts/unibody_8-smallcaps-webfont.woff) format("woff")', 15 | ), 16 | ) 17 | ) 18 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/font-general.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general font optimization 3 | --CSS-- 4 | a { 5 | font-weight: bold; 6 | font-size: 12px; 7 | line-height: 2em; 8 | font-family: Arial, "Trebuchet MS", serif; 9 | } 10 | b { 11 | font: 14px/1.25 Trebuchet MS, Arial, Tahoma, sans-serif; 12 | } 13 | --EXPECT-- 14 | array ( 15 | 'a' => 16 | array ( 17 | 'font' => '700 12px/2em Arial,"Trebuchet MS",serif', 18 | ), 19 | 'b' => 20 | array ( 21 | 'font' => '14px/1.25 "Trebuchet MS",Arial,Tahoma,sans-serif', 22 | ), 23 | ) 24 | --SETTINGS-- 25 | optimise_shorthands=2 -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/selectors/pseudo-elements.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Pseudo elements selectors 3 | --CSS-- 4 | P:first-line { display: inherit; } 5 | P:first-letter { font-size: inherit; } 6 | H1:before { font-family: inherit; } 7 | H1:after { font-weight: inherit; } 8 | --EXPECT-- 9 | array ( 10 | 'P:first-line' => 11 | array ( 12 | 'display' => 'inherit', 13 | ), 14 | 'P:first-letter' => 15 | array ( 16 | 'font-size' => 'inherit', 17 | ), 18 | 'H1:before' => 19 | array ( 20 | 'font-family' => 'inherit', 21 | ), 22 | 'H1:after' => 23 | array ( 24 | 'font-weight' => 'inherit', 25 | ), 26 | ) -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/background-noopt.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general background optimization 3 | --CSS-- 4 | a { 5 | background-color: white; 6 | background-image: url(123); 7 | background-repeat: no-repeat; 8 | background-position: 1px 1px; 9 | background-attachment: scroll; 10 | } 11 | --EXPECT-- 12 | array ( 13 | 'a' => 14 | array ( 15 | 'background-color' => '#fff', 16 | 'background-image' => 'url(123)', 17 | 'background-repeat' => 'no-repeat', 18 | 'background-position' => '1px 1px', 19 | 'background-attachment' => 'scroll', 20 | ), 21 | ) 22 | --SETTINGS-- 23 | optimise_shorthands=1 -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/class.csstidy_harness.php: -------------------------------------------------------------------------------- 1 | assert($expectation, $filename, '%s'); 15 | // this is necessary because SimpleTest doesn't support 16 | // HTML messages; this probably should be in the reporter. 17 | // This is *not* compatible with XmlReporter 18 | if (!$result) echo $expectation->render(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/README: -------------------------------------------------------------------------------- 1 | CSST 2 | 3 | These test are for CSSTidy's parsing algorithms. They take this form: 4 | 5 | --TEST-- 6 | Test name 7 | --CSS-- 8 | CSS to parse 9 | --EXPECT-- 10 | var_export() representation of csstidy->css[41] 11 | 12 | Note carefully that EXPECT is for csstidy->css[41], not csstidy->css. This 13 | is because, by default, all declarations are placed inside the 14 | DEFAULT_AT section. For tests that need to make use of at selectors, use 15 | 16 | --FULLEXPECT-- 17 | var_export() representation of csstidy->css 18 | 19 | ...instead. 20 | 21 | See also: class.csstidy_csst.php (the implementation of these tests) and 22 | test.csst.php (the caller stub for SimpleTest) 23 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/print-plain/ie-hacks.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | IE Hacks Issue/5 3 | --SETTINGS-- 4 | discard_invalid_properties = 0 5 | --CSS-- 6 | fakeList a { 7 | width: 100%; 8 | display: block; 9 | height: 30px; 10 | padding-top: 2px; 11 | -padding-top: 0; 12 | line-height:18px; 13 | *line-height:17; 14 | /line-height:none; 15 | // background-image: url(images/cellpic3.gif); /* should be ignored */ 16 | _background-image: url(/ttt/gf.gif); 17 | } 18 | --PRINT-- 19 | fakeList a { 20 | width:100%; 21 | display:block; 22 | height:30px; 23 | padding-top:2px; 24 | -padding-top:0; 25 | line-height:18px; 26 | *line-height:17; 27 | /line-height:none; 28 | _background-image:url(/ttt/gf.gif) 29 | } 30 | --SETTINGS-- -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/font-family.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Tests numeric values: Floating point 3 | --CSS-- 4 | a { font:10px Arial, sans-serif} 5 | b { font:10px "Arial", "Trebuchet MS","sans-serif"} 6 | em { font:10px/normal "Arial", "Trebuchet MS","sans-serif"} 7 | i { font:10px/1.5em "Arial", "Trebuchet MS","sans-serif"} 8 | --EXPECT-- 9 | array ( 10 | 'a' => 11 | array ( 12 | 'font' => '10px Arial,sans-serif', 13 | ), 14 | 'b' => 15 | array ( 16 | 'font' => '10px Arial,"Trebuchet MS",sans-serif', 17 | ), 18 | 'em' => 19 | array ( 20 | 'font' => '10px/normal Arial,"Trebuchet MS",sans-serif', 21 | ), 22 | 'i' => 23 | array ( 24 | 'font' => '10px/1.5em Arial,"Trebuchet MS",sans-serif', 25 | ), 26 | ) 27 | --SETTINGS-- 28 | optimise_shorthands=2 29 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/values/quoted-strings.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Ensure that quoted strings are left unchanged. 3 | --CSS-- 4 | a:after { 5 | content: "This is a typical string with words, commas, and a period."; 6 | } 7 | 8 | b:after { 9 | content: "This string has CSS-like content: foo { color: rgb(0, 0, 0); }."; 10 | } 11 | 12 | c:after { 13 | content: 'This string uses single quotes, not double (").'; 14 | } 15 | --EXPECT-- 16 | array ( 17 | 'a:after' => 18 | array ( 19 | 'content' => '"This is a typical string with words, commas, and a period."', 20 | ), 21 | 'b:after' => 22 | array ( 23 | 'content' => '"This string has CSS-like content: foo { color: rgb(0, 0, 0); }."', 24 | ), 25 | 'c:after' => 26 | array ( 27 | 'content' => '\'This string uses single quotes, not double (").\'', 28 | ), 29 | ) 30 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests.inc: -------------------------------------------------------------------------------- 1 | 22 | array ( 23 | 'width' => '100%', 24 | 'display' => 'block', 25 | 'height' => '30px', 26 | 'padding-top' => '2px', 27 | '-padding-top' => '0', 28 | 'line-height' => '18px', 29 | '-moz-border-radius' => '10px', 30 | '*line-height' => '17', 31 | '/line-height' => 'none', 32 | '_background-image' => 'url(/ttt/gf.gif)', 33 | ), 34 | ) -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/bugshorthand1.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general font optimization 3 | --CSS-- 4 | .form-suggest { 5 | height : 200px ; 6 | background : #DEE2D0 ; 7 | vertical-align : top; 8 | } 9 | 10 | body{ 11 | color: #000000; 12 | font : 11px Verdana, Arial, Helvetica, sans-serif ; 13 | margin: 0 10px 10px 10px; 14 | padding: 0; 15 | overflow:auto; 16 | } 17 | --EXPECT-- 18 | array ( 19 | '.form-suggest' => 20 | array ( 21 | 'height' => '200px', 22 | 'background' => '#DEE2D0', 23 | 'vertical-align' => 'top', 24 | ), 25 | 'body' => 26 | array ( 27 | 'color' => '#000', 28 | 'font' => '11px Verdana,Arial,Helvetica,sans-serif', 29 | 'margin' => '0 10px 10px', 30 | 'padding' => '0', 31 | 'overflow' => 'auto', 32 | ), 33 | ) 34 | --SETTINGS-- 35 | optimise_shorthands=1 36 | sort_selectors=0 37 | sort_properties=0 38 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/bugshorthand2.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general font optimization 3 | --CSS-- 4 | .form-suggest { 5 | height : 200px ; 6 | background : #DEE2D0 ; 7 | vertical-align : top; 8 | } 9 | 10 | body{ 11 | color: #000000; 12 | font : 11px Verdana, Arial, Helvetica, sans-serif ; 13 | margin: 0 10px 10px 10px; 14 | padding: 0; 15 | overflow:auto; 16 | } 17 | --EXPECT-- 18 | array ( 19 | '.form-suggest' => 20 | array ( 21 | 'height' => '200px', 22 | 'background' => '#DEE2D0', 23 | 'vertical-align' => 'top', 24 | ), 25 | 'body' => 26 | array ( 27 | 'color' => '#000', 28 | 'font' => '11px Verdana,Arial,Helvetica,sans-serif', 29 | 'margin' => '0 10px 10px', 30 | 'padding' => '0', 31 | 'overflow' => 'auto', 32 | ), 33 | ) 34 | --SETTINGS-- 35 | optimise_shorthands=2 36 | sort_selectors=0 37 | sort_properties=0 38 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/vendor-prefixed/webkit-gradient.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | -webkit-gradient properties issue/3 3 | --CSS-- 4 | .linear { 5 | background: -webkit-gradient(linear, left top, left bottom, from(#00abeb), to(#fff), color-stop(0.5, #fff), color-stop(0.5, #66cc00)); 6 | } 7 | .radial { 8 | background: -webkit-gradient(radial, 45 45, 10, 52 50, 30, from(#A7D30C), to(rgba(1,159,98,0)), color-stop(90%, #019F62)); 9 | } 10 | --EXPECT-- 11 | array ( 12 | '.linear' => 13 | array ( 14 | 'background' => '-webkit-gradient(linear,left top,left bottom,from(#00abeb),to(#fff),color-stop(0.5,#fff),color-stop(0.5,#6c0))', 15 | ), 16 | '.radial' => 17 | array ( 18 | 'background' => '-webkit-gradient(radial,45 45,10,52 50,30,from(#A7D30C),to(rgba(1,159,98,0)),color-stop(90%,#019F62))', 19 | ), 20 | ) 21 | --SETTINGS-- 22 | discard_invalid_properties=false 23 | optimise_shorthands=0 24 | css_level='CSS21' -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/ie-hacks.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | IE Hacks Issue/5 3 | --SETTINGS-- 4 | discard_invalid_properties = 0 5 | --CSS-- 6 | fakeList a { 7 | width: 100%; 8 | display: block; 9 | height: 30px; 10 | padding-top: 2px; 11 | -padding-top: 0; 12 | line-height:18px; 13 | *line-height:17; 14 | /line-height:none; 15 | // background-image: url(images/cellpic3.gif); /* should be ignored in print version*/ 16 | _background-image: url(/ttt/gf.gif); 17 | } 18 | --EXPECT-- 19 | array ( 20 | 'fakeList a' => 21 | array ( 22 | 'width' => '100%', 23 | 'display' => 'block', 24 | 'height' => '30px', 25 | 'padding-top' => '2px', 26 | '-padding-top' => '0', 27 | 'line-height' => '18px', 28 | '*line-height' => '17', 29 | '/line-height' => 'none', 30 | '//background-image' => 'url(images/cellpic3.gif)', 31 | '_background-image' => 'url(/ttt/gf.gif)', 32 | ), 33 | ) 34 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/same-atmedia-merge.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Don't merge multiples occurences of same @media 3 | --SETTINGS-- 4 | merge_selectors = 0 5 | --CSS-- 6 | BODY { 7 | color: black; 8 | } 9 | 10 | @media screen, tv, projection { 11 | BODY { 12 | background-color: red; 13 | } 14 | } 15 | 16 | @media screen, tv, projection { 17 | BODY { 18 | color: green; 19 | } 20 | } 21 | 22 | BODY { 23 | background-color: white; 24 | } 25 | 26 | --FULLEXPECT-- 27 | array ( 28 | 41 => 29 | array ( 30 | 'BODY' => 31 | array ( 32 | 'color' => '#000', 33 | ), 34 | ), 35 | '@media screen,tv,projection ' => 36 | array ( 37 | 'BODY' => 38 | array ( 39 | 'background-color' => 'red', 40 | 'color' => 'green', 41 | ), 42 | ), 43 | 42 => 44 | array ( 45 | 'BODY' => 46 | array ( 47 | 'background-color' => '#fff', 48 | ), 49 | ), 50 | ) 51 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/margin-general.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test margin optimization 3 | --CSS-- 4 | a { 5 | margin-left: 10px; 6 | margin-right: 10px; 7 | margin-top: 10px; 8 | margin-bottom: 10px; 9 | } 10 | b { 11 | margin-left: 6px; 12 | margin-right: 6px; 13 | margin-top: 10px; 14 | margin-bottom: 10px; 15 | } 16 | c { 17 | margin-left: 6px; 18 | margin-right: 6px; 19 | margin-top: 10px; 20 | margin-bottom: 1px; 21 | } 22 | d { 23 | margin-left: 1px; 24 | margin-right: 6px; 25 | margin-top: 10px; 26 | margin-bottom: 3px; 27 | } 28 | --EXPECT-- 29 | array ( 30 | 'a' => 31 | array ( 32 | 'margin' => '10px', 33 | ), 34 | 'b' => 35 | array ( 36 | 'margin' => '10px 6px', 37 | ), 38 | 'c' => 39 | array ( 40 | 'margin' => '10px 6px 1px', 41 | ), 42 | 'd' => 43 | array ( 44 | 'margin' => '10px 6px 3px 1px', 45 | ), 46 | ) 47 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/padding-general.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test padding optimization 3 | --CSS-- 4 | a { 5 | padding-left: 10px; 6 | padding-right: 10px; 7 | padding-top: 10px; 8 | padding-bottom: 10px; 9 | } 10 | b { 11 | padding-left: 10px; 12 | padding-right: 10px; 13 | padding-top: 2px; 14 | padding-bottom: 2px; 15 | } 16 | c { 17 | padding-left: 10px; 18 | padding-right: 10px; 19 | padding-top: 2px; 20 | padding-bottom: 3px; 21 | } 22 | d { 23 | padding-left: 1px; 24 | padding-right: 10px; 25 | padding-top: 2px; 26 | padding-bottom: 3px; 27 | } 28 | --EXPECT-- 29 | array ( 30 | 'a' => 31 | array ( 32 | 'padding' => '10px', 33 | ), 34 | 'b' => 35 | array ( 36 | 'padding' => '2px 10px', 37 | ), 38 | 'c' => 39 | array ( 40 | 'padding' => '2px 10px 3px', 41 | ), 42 | 'd' => 43 | array ( 44 | 'padding' => '2px 10px 3px 1px', 45 | ), 46 | ) 47 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/font-face-simple.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | @font-face rules 3 | --CSS-- 4 | @font-face { 5 | font-family: GillSans; 6 | src:url("/generic/fonts/GillSansLightC.otf") format('opentype'); 7 | font-style: normal; 8 | font-weight: normal; 9 | } 10 | 11 | @font-face { 12 | font-family: GillSans; 13 | src:url("/generic/fonts/GillSansC.otf") format('opentype'); 14 | font-style: normal; 15 | font-weight: bold; 16 | } 17 | --FULLEXPECT-- 18 | array ( 19 | ' ' => array( 20 | '@font-face' => 21 | array ( 22 | 'font-family' => 'GillSans', 23 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype")', 24 | 'font-style' => 'normal', 25 | 'font-weight' => '400', 26 | ), 27 | '@font-face ' => 28 | array ( 29 | 'font-family' => 'GillSans', 30 | 'src' => 'url(/generic/fonts/GillSansC.otf) format("opentype")', 31 | 'font-style' => 'normal', 32 | 'font-weight' => '700', 33 | ), 34 | ) 35 | ) 36 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/properties/preserve-merging.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Preserve merging of properties issue/2 3 | --CSS-- 4 | div { 5 | display:block; 6 | display:inline-block; 7 | } 8 | .gradient { 9 | background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0.15, rgba(215,240,240,0.9)), color-stop(0.5, rgba(235,250,250,0))); 10 | background-image: -moz-linear-gradient(bottom,rgba(215,240,240,0.9),rgba(235,250,250,0)) #ebf7f9; 11 | } 12 | --EXPECT-- 13 | array ( 14 | 'div' => 15 | array ( 16 | 'display' => 'block', 17 | 'display ' => 'inline-block', 18 | ), 19 | '.gradient' => 20 | array ( 21 | 'background-image' => '-webkit-gradient(linear,left bottom,left top,color-stop(0.15,rgba(215,240,240,0.9)),color-stop(0.5,rgba(235,250,250,0)))', 22 | 'background-image ' => '-moz-linear-gradient(bottom,rgba(215,240,240,0.9),rgba(235,250,250,0)) #ebf7f9', 23 | ), 24 | ) 25 | --SETTINGS-- 26 | discard_invalid_properties=false 27 | optimise_shorthands=0 28 | css_level='CSS21' 29 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/atmedia-decimals.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Decimal values in @media selectors should be maintained. 3 | --CSS-- 4 | @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { 5 | #browserHigh { 6 | background-image: url(http://design5279.files.wordpress.com/2012/04/browser-128.png); 7 | } 8 | 9 | #internetHigh { 10 | background-image: url(http://design5279.files.wordpress.com/2012/04/internet-128.png); 11 | } 12 | } 13 | --FULLEXPECT-- 14 | array ( 15 | '@media only screen and (-webkit-min-device-pixel-ratio: 1.5),only screen and (min-device-pixel-ratio: 1.5) ' => 16 | array ( 17 | '#browserHigh' => 18 | array ( 19 | 'background-image' => 'url(http://design5279.files.wordpress.com/2012/04/browser-128.png)', 20 | ), 21 | '#internetHigh' => 22 | array ( 23 | 'background-image' => 'url(http://design5279.files.wordpress.com/2012/04/internet-128.png)', 24 | ), 25 | ), 26 | ) 27 | --SETTINGS-- 28 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/same-atmedia-nomerge.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Don't merge multiples occurences of same @media 3 | --SETTINGS-- 4 | merge_selectors = 0 5 | --CSS-- 6 | @media screen, tv, projection { 7 | BODY { 8 | background-color: red; 9 | } 10 | } 11 | 12 | BODY { 13 | color: black; 14 | } 15 | 16 | @media screen, tv, projection { 17 | BODY { 18 | color: green; 19 | } 20 | } 21 | 22 | BODY { 23 | background-color: white; 24 | } 25 | 26 | --FULLEXPECT-- 27 | array ( 28 | '@media screen,tv,projection ' => 29 | array ( 30 | 'BODY' => 31 | array ( 32 | 'background-color' => 'red', 33 | ), 34 | ), 35 | 41 => 36 | array ( 37 | 'BODY' => 38 | array ( 39 | 'color' => '#000', 40 | ), 41 | ), 42 | '@media screen,tv,projection ' => 43 | array ( 44 | 'BODY' => 45 | array ( 46 | 'color' => 'green', 47 | ), 48 | ), 49 | 42 => 50 | array ( 51 | 'BODY' => 52 | array ( 53 | 'background-color' => '#fff', 54 | ), 55 | ), 56 | ) 57 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/font-face-mini.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | @font-face rules 3 | --CSS-- 4 | @font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')} 5 | --FULLEXPECT-- 6 | array ( 7 | ' ' => array( 8 | '@font-face' => 9 | array ( 10 | 'font-family' => '\'Glyphicons Halflings\'', 11 | 'src' => 'url(../fonts/glyphicons-halflings-regular.eot)', 12 | 'src ' => 'url(../fonts/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"),url(../fonts/glyphicons-halflings-regular.woff) format("woff"),url(../fonts/glyphicons-halflings-regular.ttf) format("truetype"),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format("svg")', 13 | ), 14 | ), 15 | ) 16 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/properties/multiple-properties.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Support for multiple background properties. 3 | --CSS-- 4 | body { 5 | background: linear-gradient(bottom, rgb(153,102,51) 0%, rgb(51,153,102) 30%, rgb(102,51,153) 100%); 6 | background: -o-linear-gradient(bottom, rgb(153,102,51) 0%, rgb(51,153,102) 30%, rgb(102,51,153) 100%); 7 | background: -moz-linear-gradient(bottom, rgb(153,102,51) 0%, rgb(51,153,102) 30%, rgb(102,51,153) 100%); 8 | background: -webkit-linear-gradient(bottom, rgb(153,102,51) 0%, rgb(51,153,102) 30%, rgb(102,51,153) 100%); 9 | background: -ms-linear-gradient(bottom, rgb(153,102,51) 0%, rgb(51,153,102) 30%, rgb(102,51,153) 100%); 10 | } 11 | --EXPECT-- 12 | array ( 13 | 'body' => 14 | array ( 15 | 'background' => 'linear-gradient(bottom,#963 0%,#396 30%,#639 100%)', 16 | 'background ' => '-o-linear-gradient(bottom,#963 0%,#396 30%,#639 100%)', 17 | 'background ' => '-moz-linear-gradient(bottom,#963 0%,#396 30%,#639 100%)', 18 | 'background ' => '-webkit-linear-gradient(bottom,#963 0%,#396 30%,#639 100%)', 19 | 'background ' => '-ms-linear-gradient(bottom,#963 0%,#396 30%,#639 100%)', 20 | ), 21 | ) 22 | -------------------------------------------------------------------------------- /Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "Preferences", 4 | "mnemonic": "n", 5 | "id": "preferences", 6 | "children": 7 | [ 8 | { 9 | "caption": "Package Settings", 10 | "mnemonic": "P", 11 | "id": "package-settings", 12 | "children": 13 | [ 14 | { 15 | "caption": "CSSTidy", 16 | "children": 17 | [ 18 | { 19 | "command": "open_file", 20 | "args": {"file": "${packages}/CSSTidy/CSSTidy.sublime-settings"}, 21 | "caption": "Settings – Default" 22 | }, 23 | { 24 | "command": "open_file", 25 | "args": {"file": "${packages}/User/CSSTidy.sublime-settings"}, 26 | "caption": "Settings – User" 27 | }, 28 | { "caption": "-" } 29 | ] 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | ] 36 | -------------------------------------------------------------------------------- /csstidy.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | // true or false 3 | //"remove_bslash": true 4 | 5 | // false or true 6 | //"lowercase_s": false, 7 | 8 | // false or true 9 | //"timestamp": false, 10 | 11 | // "1", "2", "0" 12 | //"optimise_shorthands": "1", 13 | 14 | // false or true 15 | //"remove_last_;": false, 16 | 17 | // false or true 18 | //"sort_selectors": false, 19 | 20 | // true or false 21 | //"compress_font-weight": true, 22 | 23 | // false or true 24 | // "discard_invalid_properties": false, 25 | 26 | // false or true 27 | // "discard_invalid_selectors": false, 28 | 29 | //"0", "1", "2" 30 | //"case_properties": "0", 31 | 32 | // true or false 33 | //"compress_colors": "true", 34 | 35 | // false or true 36 | //"lowercase_s": "false", 37 | 38 | // default, filename, low, high, highest, template_string 39 | // if 'filename', looks for in the User folder of the packages directory 40 | // A sample file (medium-template.txt) is in the csstidy package folder. 41 | // More info on templates: http://csstidy.sourceforge.net/templates.php 42 | "template": "default", 43 | 44 | // false or true 45 | "preserve_css": "true", 46 | 47 | // false or true 48 | "sort_properties": "false", 49 | 50 | // "2", "1", "0" 51 | "merge_selectors": "0" 52 | 53 | } -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/print-plain/font-face-atmedia.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test simple CSS print 3 | --CSS-- 4 | /* Based on the original Style Sheet for the fisubsilver v2 Theme for phpBB version 2+ 5 | Edited by Daz - http://www.forumimages.com - last updated 26-06-03 */ 6 | /* The content of the posts (body of text) */ 7 | /* General page style */ 8 | 9 | /* begin suggest post */ 10 | .float-l { 11 | float : left ; 12 | } 13 | 14 | @font-face { 15 | font-family: GillSans; 16 | src:url("/generic/fonts/GillSansC.otf") format('opentype'); 17 | font-style: normal; 18 | font-weight: bold; 19 | } 20 | 21 | .font-9{ 22 | font-size: 11px; 23 | } 24 | 25 | @media print { 26 | .font-9{ 27 | font-size: 9px; 28 | } 29 | } 30 | 31 | .form-suggest { 32 | height : 200px ; 33 | background : #DEE2D0 ; 34 | vertical-align : top; 35 | } 36 | 37 | 38 | --PRINT-- 39 | @media screen { 40 | .float-l{float:left} 41 | } 42 | @font-face{font-family:GillSans;src:url(/generic/fonts/GillSansC.otf) format("opentype");font-style:normal;font-weight:700} 43 | @media screen { 44 | .font-9{font-size:11px} 45 | } 46 | @media print { 47 | .font-9{font-size:9px} 48 | } 49 | @media screen { 50 | .form-suggest{height:200px;background:#DEE2D0;vertical-align:top} 51 | } 52 | --SETTINGS-- 53 | template='high' 54 | sort_properties=false 55 | sort_selectors=false 56 | default_media="@media screen" -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/print-plain/simple-highest.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test simple CSS print 3 | --CSS-- 4 | /* Based on the original Style Sheet for the fisubsilver v2 Theme for phpBB version 2+ 5 | Edited by Daz - http://www.forumimages.com - last updated 26-06-03 */ 6 | /* The content of the posts (body of text) */ 7 | /* General page style */ 8 | 9 | /* begin suggest post */ 10 | .float-l { 11 | float : left ; 12 | } 13 | 14 | .form-suggest { 15 | height : 200px ; 16 | background : #DEE2D0 ; 17 | vertical-align : top; 18 | } 19 | 20 | .form-input input{ 21 | font-size: 10px; 22 | } 23 | 24 | .form-input textarea{ 25 | font-size: 11px; 26 | width: 350px; 27 | } 28 | 29 | .form-label{ 30 | font-size: 10px; 31 | font-weight: bold; 32 | line-height: 25px; 33 | padding-right: 10px; 34 | text-align: right; 35 | width: 100px; 36 | color: #39738F; 37 | } 38 | 39 | .font-9{ 40 | font-size: 9px; 41 | } 42 | --PRINT-- 43 | .float-l{float:left}.form-suggest{height:200px;background:#DEE2D0;vertical-align:top}.form-input input{font-size:10px}.form-input textarea{font-size:11px;width:350px}.form-label{font-size:10px;font-weight:700;line-height:25px;padding-right:10px;text-align:right;width:100px;color:#39738F}.font-9{font-size:9px} 44 | --SETTINGS-- 45 | template='highest' 46 | sort_properties=false 47 | sort_selectors=false -------------------------------------------------------------------------------- /csstidyphp/NEWS: -------------------------------------------------------------------------------- 1 | Changelog 2 | 3 | Key: # = backwards incompatible change, ! = new feature, - = bugfix. 4 | 5 | 1.4, unknown release date 6 | # CSSTidy is now licensed under LGPL! 7 | ! csstidy->set_cfg now accept a single parameter, an associative array, to 8 | set all configuration options 9 | ! Templates can now be loaded via set_cfg using the 'template' config 10 | parameter 11 | ! csstidy_print->formatted_page added, returns a full XHTML page based 12 | off of csstidy_print->formatted 13 | ! cssparsed.css created, contains just the CSS for formatted CSS output 14 | ! New CSS 3 units "ch" and "turn" added 15 | ! Unit tests added, requires Text_Diff (PEAR) and SimpleTest 16 | ! Some invalid selectors are now removed during optimization, this can 17 | be turned off by setting 'discard_invalid_selectors' to false 18 | - Added localizations for css_optimiser.php 19 | - Fixed bug with cookie setting for custom templates 20 | - Minor security problem in css_optimiser.php fixed 21 | - Fixed bug with float handling in exotic locales 22 | - Fixed bug with non-functioning getenv in ASAPI 23 | - Fixed bug with bad hexadecimal syntax recovery 24 | - At-selectors optimized by removing unnecessary url() 25 | - Fixed optimisation: 1.0 was not optimised to 1 26 | - Fixed incorrect parsing of !imporant close to numbers 27 | - Allowed Copy to Clipboard for Firefox if preference set (if not, gives 28 | instructions on how to add and warning re: security) -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/print-plain/simple-high.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test simple CSS print 3 | --CSS-- 4 | /* Based on the original Style Sheet for the fisubsilver v2 Theme for phpBB version 2+ 5 | Edited by Daz - http://www.forumimages.com - last updated 26-06-03 */ 6 | /* The content of the posts (body of text) */ 7 | /* General page style */ 8 | 9 | /* begin suggest post */ 10 | .float-l { 11 | float : left ; 12 | } 13 | 14 | .form-suggest { 15 | height : 200px ; 16 | background : #DEE2D0 ; 17 | vertical-align : top; 18 | } 19 | 20 | .form-input input{ 21 | font-size: 10px; 22 | } 23 | 24 | .form-input textarea{ 25 | font-size: 11px; 26 | width: 350px; 27 | } 28 | 29 | .form-label{ 30 | font-size: 10px; 31 | font-weight: bold; 32 | line-height: 25px; 33 | padding-right: 10px; 34 | text-align: right; 35 | width: 100px; 36 | color: #39738F; 37 | } 38 | 39 | .font-9{ 40 | font-size: 9px; 41 | } 42 | --PRINT-- 43 | .float-l{float:left} 44 | .form-suggest{height:200px;background:#DEE2D0;vertical-align:top} 45 | .form-input input{font-size:10px} 46 | .form-input textarea{font-size:11px;width:350px} 47 | .form-label{font-size:10px;font-weight:700;line-height:25px;padding-right:10px;text-align:right;width:100px;color:#39738F} 48 | .font-9{font-size:9px} 49 | --SETTINGS-- 50 | template='high' 51 | sort_properties=false 52 | sort_selectors=false -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/shorthands/bugshorthand3.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test general font optimization 3 | --CSS-- 4 | .form-suggest { 5 | height : 200px ; 6 | background : #DEE2D0 ; 7 | vertical-align : top; 8 | } 9 | 10 | body{ 11 | color: #000000; 12 | font : 11px Verdana, Arial, Helvetica, sans-serif ; 13 | margin: 0 10px 10px 10px; 14 | padding: 0; 15 | overflow:auto; 16 | } 17 | .degrade{ 18 | background-color:#777777; 19 | background:-webkit-gradient(linear,left top,left bottom,from(#999999),to(#666666)); 20 | background-image:-moz-linear-gradient(top,#999999,#666666); 21 | } 22 | 23 | .sans {background:none;} 24 | --EXPECT-- 25 | array ( 26 | '.form-suggest' => 27 | array ( 28 | 'height' => '200px', 29 | 'background' => '#DEE2D0', 30 | 'vertical-align' => 'top', 31 | ), 32 | 33 | 'body' => 34 | array ( 35 | 'color' => '#000', 36 | 'font' => '11px Verdana,Arial,Helvetica,sans-serif', 37 | 'margin' => '0 10px 10px', 38 | 'padding' => '0', 39 | 'overflow' => 'auto', 40 | ), 41 | '.degrade' => 42 | array ( 43 | 'background-color' => '#777', 44 | 'background' => '-webkit-gradient(linear,left top,left bottom,from(#999),to(#666))', 45 | 'background-image' => '-moz-linear-gradient(top,#999,#666)', 46 | ), 47 | '.sans' => 48 | array ( 49 | 'background' => 'none', 50 | ), 51 | 52 | ) 53 | --SETTINGS-- 54 | optimise_shorthands=3 55 | sort_selectors=0 56 | sort_properties=0 -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/newlines.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | @font-face rules 3 | --CSS-- 4 | a { 5 | background: -webkit-gradient( 6 | linear, 7 | left bottom, 8 | left top, 9 | color-stop(0, rgb(153,102,51)), 10 | color-stop(0.3, rgb(51,153,102)), 11 | color-stop(1, rgb(102,51,153)) 12 | ); 13 | content: "ABC 14 | 123 15 | DEF 16 | GHI"; 17 | } 18 | b { 19 | content: "ABC\A123"; 20 | } 21 | i { 22 | content: 'ABC 23 | 123\ADEF'; 24 | } 25 | 26 | u { 27 | background: parenthetical( 28 | "string 1", 29 | "string 30 | 2", 31 | 'string 3', 32 | 'string "4', 33 | 'string "5"', 34 | "string '6", 35 | "string (7)", 36 | "string 8)", 37 | ( 38 | ( 39 | ( 40 | ( 41 | ("boo") 42 | ) 43 | ) 44 | ) 45 | ), 46 | ( 47 | ( 48 | ( 49 | ( 50 | ("boo ba") 51 | ) 52 | ) 53 | ) 54 | ) 55 | 56 | ); 57 | } 58 | --EXPECT-- 59 | array ( 60 | 'a' => 61 | array ( 62 | 'background' => '-webkit-gradient(linear,left bottom,left top,color-stop(0,#963),color-stop(0.3,#396),color-stop(1,#639))', 63 | 'content' => '"ABC\\A123\\ADEF\\AGHI"', 64 | ), 65 | 'b' => 66 | array ( 67 | 'content' => '"ABC\\A123"', 68 | ), 69 | 'i' => 70 | array ( 71 | 'content' => '\'ABC\\A123\\ADEF\'', 72 | ), 73 | 'u' => 74 | array ( 75 | 'background' => 'parenthetical("string 1","string\\A2",\'string 3\',\'string "4\',\'string "5"\',"string \'6","string (7)","string 8)",(((((boo))))),((((("boo ba"))))))', 76 | ), 77 | ) 78 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/print-plain/simple-default.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test simple CSS print 3 | --CSS-- 4 | /* Based on the original Style Sheet for the fisubsilver v2 Theme for phpBB version 2+ 5 | Edited by Daz - http://www.forumimages.com - last updated 26-06-03 */ 6 | /* The content of the posts (body of text) */ 7 | /* General page style */ 8 | 9 | /* begin suggest post */ 10 | .float-l { 11 | float : left ; 12 | } 13 | 14 | .form-suggest { 15 | height : 200px ; 16 | background : #DEE2D0 ; 17 | vertical-align : top; 18 | } 19 | 20 | .form-input input{ 21 | font-size: 10px; 22 | } 23 | 24 | .form-input textarea{ 25 | font-size: 11px; 26 | width: 350px; 27 | } 28 | 29 | .form-label{ 30 | font-size: 10px; 31 | font-weight: bold; 32 | line-height: 25px; 33 | padding-right: 10px; 34 | text-align: right; 35 | width: 100px; 36 | color: #39738F; 37 | } 38 | 39 | .font-9{ 40 | font-size: 9px; 41 | } 42 | --PRINT-- 43 | .float-l { 44 | float:left 45 | } 46 | 47 | .form-suggest { 48 | height:200px; 49 | background:#DEE2D0; 50 | vertical-align:top 51 | } 52 | 53 | .form-input input { 54 | font-size:10px 55 | } 56 | 57 | .form-input textarea { 58 | font-size:11px; 59 | width:350px 60 | } 61 | 62 | .form-label { 63 | font-size:10px; 64 | font-weight:700; 65 | line-height:25px; 66 | padding-right:10px; 67 | text-align:right; 68 | width:100px; 69 | color:#39738F 70 | } 71 | 72 | .font-9 { 73 | font-size:9px 74 | } 75 | --SETTINGS-- 76 | sort_properties=false 77 | sort_selectors=false -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/properties/importance.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Testing proper parsing of importance. 3 | --CSS-- 4 | a { 5 | width: 100px; 6 | height: 200px; 7 | } 8 | 9 | a { 10 | width: 400px !important; 11 | height: 300px; 12 | } 13 | 14 | b { 15 | width: 100px !important; 16 | height: 200px; 17 | } 18 | 19 | b { 20 | width: 400px; 21 | height: 300px !important; 22 | } 23 | 24 | c { 25 | width: 100px!important; 26 | } 27 | 28 | d { 29 | width: 100px; 30 | } 31 | 32 | d { 33 | width: 200px !IMPORTANT; 34 | } 35 | 36 | d { 37 | width: 300px ! important; 38 | } 39 | 40 | e { 41 | background-image: url(http://example.com/test.png) !importANT; 42 | } 43 | 44 | f { 45 | background-image: url(http://example.com/test.png)!imPORTant; 46 | } 47 | --EXPECT-- 48 | array ( 49 | 'a' => 50 | array ( 51 | 'width' => '100px', 52 | 'height' => '200px', 53 | 'width ' => '400px!important', 54 | 'height ' => '300px', 55 | ), 56 | 'b' => 57 | array ( 58 | 'width' => '100px!important', 59 | 'height' => '200px', 60 | 'width ' => '400px', 61 | 'height ' => '300px!important', 62 | ), 63 | 'c' => 64 | array ( 65 | 'width' => '100px!important', 66 | ), 67 | 'd' => 68 | array ( 69 | 'width' => '100px', 70 | 'width ' => '200px!important', 71 | 'width ' => '300px!important', 72 | ), 73 | 'e' => 74 | array ( 75 | 'background-image' => 'url(http://example.com/test.png)!important', 76 | ), 77 | 'f' => 78 | array ( 79 | 'background-image' => 'url(http://example.com/test.png)!important', 80 | ), 81 | ) 82 | -------------------------------------------------------------------------------- /csstidyphp/class.csstidy_ctype.php: -------------------------------------------------------------------------------- 1 | '. $this->original .''. $this->final .''; 18 | } 19 | function _endDiff() { 20 | return ''; 21 | } 22 | function _context($lines) { 23 | return '
'. htmlspecialchars(implode("\n", $lines)) .'
24 |
'. htmlspecialchars(implode("\n", $lines)) .'
'; 25 | } 26 | function _added($lines) { 27 | return ' 
'. htmlspecialchars(implode("\n", $lines)) .'
'; 28 | } 29 | function _deleted($lines) { 30 | return '
'. htmlspecialchars(implode("\n", $lines)) .'
 '; 31 | } 32 | function _changed($orig, $final) { 33 | return '
'. htmlspecialchars(implode("\n", $orig)) .'
34 |
'. htmlspecialchars(implode("\n", $final)) .'
'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/complex-gradient.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | multiples cursor rules 3 | --CSS-- 4 | .degrade{ 5 | background-color:#777777; 6 | background:-webkit-gradient(linear,left top, left bottom,from(#999999),to(#666666)); 7 | background-image:-moz-linear-gradient(top, #999999, #666666); 8 | /* ne pas remplacer les couleurs ci-apres */ 9 | filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#999999', endColorstr='#666666'); 10 | filter:progid:DXImageTransform.Microsoft.Shadow(color=#666666, direction=146, Strength=5); 11 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#999999', endColorstr='#666666')"; 12 | filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#ff999999',endColorstr='#ff666666'); 13 | } 14 | --EXPECT-- 15 | array ( 16 | '.degrade' => 17 | array ( 18 | 'background-color' => '#777', 19 | 'background' => '-webkit-gradient(linear,left top,left bottom,from(#999),to(#666))', 20 | 'background-image' => '-moz-linear-gradient(top,#999,#666)', 21 | 'filter' => 'progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=\'#999999\',endColorstr=\'#666666\')', 22 | 'filter ' => 'progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=146,Strength=5)', 23 | '-ms-filter' => '"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=\'#999999\',endColorstr=\'#666666\')"', 24 | 'filter ' => 'progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=\'#ff999999\',endColorstr=\'#ff666666\')', 25 | ), 26 | ) -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * Required 9 | * unit-tets/Text : http://download.pear.php.net/package/Text_Diff-1.1.1.tgz 10 | * unit-tests/simpletest/ : http://downloads.sourceforge.net/project/simpletest/simpletest/simpletest_1.0.1/simpletest_1.0.1.tar.gz?r=&ts=1289748853&use_mirror=freefr 11 | * 12 | */ 13 | 14 | error_reporting(E_ALL ^ 8192/*E_DEPRECATED*/); 15 | 16 | // Configuration 17 | $simpletest_location = 'simpletest/'; 18 | if (file_exists('../test-settings.php')) include_once '../test-settings.php'; 19 | 20 | // Includes 21 | require_once '../class.csstidy.php'; 22 | require_once 'Text/Diff.php'; 23 | require_once 'Text/Diff/Renderer.php'; 24 | require_once $simpletest_location . 'unit_tester.php'; 25 | require_once $simpletest_location . 'reporter.php'; 26 | require_once 'unit-tests/class.csstidy_reporter.php'; 27 | require_once 'unit-tests/class.csstidy_harness.php'; 28 | require_once 'unit-tests.inc'; 29 | 30 | // Test files 31 | $test_files = array(); 32 | require 'unit-tests/_files.php'; 33 | 34 | // Setup test files 35 | $test = new GroupTest('CSSTidy unit tests'); 36 | foreach ($test_files as $test_file) { 37 | require_once "unit-tests/$test_file"; 38 | list($x, $class_suffix) = explode('.', $test_file); 39 | $test->addTestClass("csstidy_test_$class_suffix"); 40 | } 41 | 42 | if (SimpleReporter::inCli()) $reporter = new TextReporter(); 43 | else $reporter = new csstidy_reporter('UTF-8'); 44 | 45 | $test->run($reporter); 46 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/print-plain/simple-low.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test simple CSS print 3 | --CSS-- 4 | /* Based on the original Style Sheet for the fisubsilver v2 Theme for phpBB version 2+ 5 | Edited by Daz - http://www.forumimages.com - last updated 26-06-03 */ 6 | /* The content of the posts (body of text) */ 7 | /* General page style */ 8 | 9 | /* begin suggest post */ 10 | .float-l { 11 | float : left ; 12 | } 13 | 14 | .form-suggest { 15 | height : 200px ; 16 | background : #DEE2D0 ; 17 | vertical-align : top; 18 | } 19 | 20 | .form-input input{ 21 | font-size: 10px; 22 | } 23 | 24 | .form-input textarea{ 25 | font-size: 11px; 26 | width: 350px; 27 | } 28 | 29 | .form-label{ 30 | font-size: 10px; 31 | font-weight: bold; 32 | line-height: 25px; 33 | padding-right: 10px; 34 | text-align: right; 35 | width: 100px; 36 | color: #39738F; 37 | } 38 | 39 | .font-9{ 40 | font-size: 9px; 41 | } 42 | --PRINT-- 43 | .float-l 44 | { 45 | float:left 46 | } 47 | 48 | .form-suggest 49 | { 50 | height:200px; 51 | background:#DEE2D0; 52 | vertical-align:top 53 | } 54 | 55 | .form-input input 56 | { 57 | font-size:10px 58 | } 59 | 60 | .form-input textarea 61 | { 62 | font-size:11px; 63 | width:350px 64 | } 65 | 66 | .form-label 67 | { 68 | font-size:10px; 69 | font-weight:700; 70 | line-height:25px; 71 | padding-right:10px; 72 | text-align:right; 73 | width:100px; 74 | color:#39738F 75 | } 76 | 77 | .font-9 78 | { 79 | font-size:9px 80 | } 81 | --SETTINGS-- 82 | template='low' 83 | sort_properties=false 84 | sort_selectors=false -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/font-face-atmedia.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test simple CSS print 3 | --CSS-- 4 | /* Based on the original Style Sheet for the fisubsilver v2 Theme for phpBB version 2+ 5 | Edited by Daz - http://www.forumimages.com - last updated 26-06-03 */ 6 | /* The content of the posts (body of text) */ 7 | /* General page style */ 8 | 9 | /* begin suggest post */ 10 | .float-l { 11 | float : left ; 12 | } 13 | 14 | @font-face { 15 | font-family: GillSans; 16 | src:url("/generic/fonts/GillSansC.otf") format('opentype'); 17 | font-style: normal; 18 | font-weight: bold; 19 | } 20 | 21 | .font-9{ 22 | font-size: 11px; 23 | } 24 | 25 | @media print { 26 | .font-9{ 27 | font-size: 9px; 28 | } 29 | } 30 | 31 | .form-suggest { 32 | height : 200px ; 33 | background : #DEE2D0 ; 34 | vertical-align : top; 35 | } 36 | 37 | 38 | --FULLEXPECT-- 39 | array ( 40 | 41 => array ( 41 | '.float-l' => 42 | array ( 43 | 'float' => 'left', 44 | ), 45 | ), 46 | ' ' => array ( 47 | '@font-face' => array ( 48 | 'font-family' => 'GillSans', 49 | 'src' => 'url(/generic/fonts/GillSansC.otf) format("opentype")', 50 | 'font-style' => 'normal', 51 | 'font-weight' => '700', 52 | ), 53 | ), 54 | 42 => array ( 55 | '.font-9' => 56 | array ( 57 | 'font-size' => '11px', 58 | ), 59 | ), 60 | '@media print ' => array ( 61 | '.font-9' => 62 | array ( 63 | 'font-size' => '9px', 64 | ), 65 | ), 66 | 43 => 67 | array ( 68 | '.form-suggest' => 69 | array ( 70 | 'height' => '200px', 71 | 'background' => '#DEE2D0', 72 | 'vertical-align' => 'top', 73 | ), 74 | ), 75 | ) 76 | --SETTINGS-- -------------------------------------------------------------------------------- /csstidyphp/cssparse.css: -------------------------------------------------------------------------------- 1 | @import "cssparsed.css"; 2 | 3 | html,body { 4 | font:.8em Verdana,Helvetica,sans-serif; 5 | background:#f8f8f6 6 | } 7 | 8 | code { 9 | font-size:1.2em 10 | } 11 | 12 | div#rightcol { 13 | padding-left:32em 14 | } 15 | 16 | fieldset { 17 | display:block; 18 | margin:.5em 0; 19 | padding:1em; 20 | border:solid #7284ab 2px 21 | } 22 | 23 | fieldset.code_output { 24 | display:inline 25 | } 26 | 27 | h1 { 28 | font-size:2em 29 | } 30 | 31 | small { 32 | font-size:.7em 33 | } 34 | 35 | fieldset#field_input { 36 | float:left; 37 | margin:0 .5em 1em 0 38 | } 39 | 40 | fieldset#options,fieldset#code_layout { 41 | width:31em 42 | } 43 | 44 | input#submit { 45 | clear:both; 46 | display:block; 47 | margin:1em 48 | } 49 | 50 | select { 51 | margin:2px 0 0 52 | } 53 | 54 | label.block { 55 | display:block 56 | } 57 | 58 | legend { 59 | background:#c4e1c3; 60 | padding:2px 4px; 61 | border:dashed 1px 62 | } 63 | 64 | textarea#css_text { 65 | width:27em; 66 | height:370px; 67 | display:block; 68 | margin-right:1em 69 | } 70 | 71 | .help { 72 | cursor:help 73 | } 74 | 75 | p.important { 76 | border:solid 1px red; 77 | font-weight:700; 78 | padding:1em; 79 | background:#fff 80 | } 81 | 82 | p { 83 | margin:1em 0 84 | } 85 | 86 | dl { 87 | padding-left:.5em 88 | } 89 | 90 | dt { 91 | font-weight:700; 92 | margin:0; 93 | float:left; 94 | clear:both; 95 | height:1.5em 96 | } 97 | 98 | dd { 99 | margin:0 0 0 4em; 100 | height:1.5em 101 | } 102 | 103 | fieldset#messages { 104 | background:#fff; 105 | padding:0 0 0 1em 106 | } 107 | 108 | fieldset#messages div { 109 | height:10em; 110 | overflow:auto 111 | } 112 | 113 | dd.Warning { 114 | color:orange 115 | } 116 | 117 | dd.Information { 118 | color:green 119 | } -------------------------------------------------------------------------------- /csstidyphp/Docs/errors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | phpDocumentor Parser Errors and Warnings 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 |
csstidy
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 |
22 | 23 | 24 | 25 | 33 | 47 | 48 |
34 |
35 | 36 | Post-parsing
37 | 38 |

data.inc.php

39 |

Warnings:


40 | Warning on line 25 - Page-level DocBlock precedes "define AT_START", use another DocBlock to document the source element
41 |
42 |
43 | Documentation generated on Mon, 15 May 2006 22:56:01 +0200 by phpDocumentor 1.3.0RC3 44 |
45 |
46 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/print-plain/font-face-atmedia-2.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test simple CSS print 3 | --CSS-- 4 | /** **/ 5 | @font-face { 6 | font-family: 'GenerikaRegular'; 7 | src: url('../fonts/generikaregular-webfont.eot'); 8 | src: url('../fonts/generikaregular-webfont.eot?#iefix') format('embedded-opentype'), 9 | url('../fonts/generikaregular-webfont.woff') format('woff'), 10 | url('../fonts/generikaregular-webfont.ttf') format('truetype'), 11 | url('../fonts/generikaregular-webfont.svg#GenerikaRegular') format('svg'); 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | 16 | @font-face { 17 | font-family: 'GenerikaLight'; 18 | src: url('../fonts/generikalight-webfont.eot'); 19 | src: url('../fonts/generikalight-webfont.eot?#iefix') format('embedded-opentype'), 20 | url('../fonts/generikalight-webfont.woff') format('woff'), 21 | url('../fonts/generikalight-webfont.ttf') format('truetype'), 22 | url('../fonts/generikalight-webfont.svg#GenerikaLight') format('svg'); 23 | font-weight: normal; 24 | font-style: normal; 25 | } 26 | 27 | p { border: none;} 28 | 29 | --PRINT-- 30 | @font-face{font-family:'GenerikaRegular';src:url(../fonts/generikaregular-webfont.eot);src:url(../fonts/generikaregular-webfont.eot?#iefix) format("embedded-opentype"),url(../fonts/generikaregular-webfont.woff) format("woff"),url(../fonts/generikaregular-webfont.ttf) format("truetype"),url(../fonts/generikaregular-webfont.svg#GenerikaRegular) format("svg");font-weight:400;font-style:normal} 31 | @font-face{font-family:'GenerikaLight';src:url(../fonts/generikalight-webfont.eot);src:url(../fonts/generikalight-webfont.eot?#iefix) format("embedded-opentype"),url(../fonts/generikalight-webfont.woff) format("woff"),url(../fonts/generikalight-webfont.ttf) format("truetype"),url(../fonts/generikalight-webfont.svg#GenerikaLight) format("svg");font-weight:400;font-style:normal} 32 | @media screen { 33 | p{border:none} 34 | } 35 | --SETTINGS-- 36 | template='high' 37 | sort_properties=false 38 | sort_selectors=false 39 | default_media="@media screen" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SublimeCSSTidy 2 | ## CSS code formatter for Sublime Text 3 | 4 | SublimeCSSTidy is a [Sublime Text](http://www.sublimetext.com/) package for cleaning and tidying up your CSS. It's mostly a wrapper for the [CSS Tidy PHP Library](http://github.com/Cerdic/CSSTidy), but it will fall back on a bundled [CSS Tidy](http://csstidy.sourceforge.net/) executable for Windows users without PHP. 5 | 6 | SublimeCSSTidy adds three commands to the command palette: 7 | 8 | * Tidy CSS (Highest Compression) 9 | * Tidy CSS (Low Compression) 10 | * Tidy CSS 11 | 12 | The last command uses the default template, which balances readability and compression. If you can decipher the complicated pattern for creating [custom formatting rules](http://csstidy.sourceforge.net/templates.php), SublimeCSSTidy will happily use them. An example of a custom template file is included (`template-medium.txt`). 13 | 14 | ### Windows Support 15 | 16 | If you do not have PHP installed, SublimeCSSTidy will use a bundled version of [CSS Tidy](http://csstidy.sourceforge.net/). This program is from 2007, and may not have complete support for all CSS3. Consider installing PHP. 17 | 18 | ### Configuration 19 | 20 | Check out `csstidy.sublime-settings` for a documented list of options. 21 | 22 | ### Installation 23 | 24 | #### With Package Control 25 | If you have [Package Control](http://github.com/wbond/sublime_package_control) installed, you can install SublimeCSSTidy from within Sublime Text 2. Open the Command Palette and enter "Package Control: Install Package", then search for *CSSTidy*. 26 | 27 | #### Without Package Control 28 | Clone the repository into your Sublime Text 2 packages directory: 29 | 30 | git clone git://github.com/fitnr/SublimeCSSTidy.git 31 | 32 | #### Without Package Control or Git 33 | [Go to the download section](http://github.com/fitnr/SublimeCSSTidy/downloads) and download the package. Unzip it, rename the folder *CSSTidy* and move it into your Sublime Text 2 packages directory (*Preferences > Browse Packages* in the menu) 34 | 35 | ### Problems? 36 | [Submit an issue](https://github.com/fitnr/SublimeCSSTidy/issues). -------------------------------------------------------------------------------- /csstidy.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | load_template('highest_compression'); 34 | break; 35 | 36 | case 'high': 37 | $css->load_template('high_compression'); 38 | break; 39 | 40 | case 'default': 41 | $css->load_template('default'); 42 | break; 43 | 44 | case 'low': 45 | $css->load_template('low_compression'); 46 | break; 47 | 48 | default: 49 | if (file_exists($args['template'])): 50 | $css->load_template($args['template'], true); 51 | else: 52 | $css->load_template('default'); 53 | endif; 54 | break; 55 | endswitch; 56 | endif; 57 | 58 | // Set config options 59 | foreach ($long_options as $option): 60 | // Important line: make sure PHP recognizes option name 61 | $option = trim($option, ":"); 62 | if (isset($args[$option]) and $option != 'template'): 63 | $css->set_cfg($option, $args[$option]); 64 | endif; 65 | endforeach; 66 | 67 | // read from pipe, parse, write to pipe 68 | $input = stream_get_contents(STDIN); 69 | $css->parse($input); 70 | fwrite(STDOUT, $css->print->plain()); 71 | 72 | /* 73 | // Is there an error handler in csstidyphp? I don't think so? 74 | if ( SOME_KIND_OF_ERROR_OPTION ) { 75 | fwrite(STDERR, $css->ERRORS); 76 | } 77 | */ 78 | ?> -------------------------------------------------------------------------------- /csstidyphp/README: -------------------------------------------------------------------------------- 1 | CSSTidy 2 | --- 3 | 4 | CSSTidy is a CSS minifier 5 | 6 | v1.5.2 7 | is PHP 5.4+ compliant, removes use of GLOBALS, fixes some bugs, integrates CSS3 units 8 | and now available on https://packagist.org/packages/cerdic/css-tidy 9 | 10 | v1.4 is the new version coming from master branch (corresponds to the initial trunk of svn repository) after beeing stabilized 11 | 12 | v1.3 branch corresponds to the last stable relase published by the author. 13 | It integrates some bugfixes and a 1.3.1 version has been taged 14 | Since the original project (http://csstidy.sourceforge.net/index.php) has been suspended 15 | here is the import of https://csstidy.svn.sourceforge.net/svnroot/csstidy on 2010-11-14 16 | 17 | Only PHP version is here maintained 18 | 19 | --- 20 | 21 | CSSTidy 22 | 23 | Original Tracker : 24 | http://sourceforge.net/tracker/?group_id=148404&atid=771415 25 | 26 | css_optimiser.php is the web-interface, css_parser.php contains the PHP class (CSSTidy). 27 | 28 | This class represents a CSS parser which reads CSS code and saves it in an array. 29 | In opposite to most other CSS parsers, it does not use regular expressions and 30 | thus has full CSS2 support and a higher reliability. The downside of not using regular expressions 31 | is a lower speed though. 32 | Additional to that it applies some optimisations and fixes to the CSS code. 33 | An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php 34 | 35 | 36 | Copyright 2005, 2006, 2007 Florian Schmitz 37 | 38 | CSSTidy is free software; you can redistribute it and/or modify 39 | it under the terms of the GNU Lesser General Public License as published by 40 | the Free Software Foundation; either version 2.1 of the License, or 41 | (at your option) any later version. 42 | 43 | CSSTidy is distributed in the hope that it will be useful, 44 | but WITHOUT ANY WARRANTY; without even the implied warranty of 45 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 46 | GNU Lesser General Public License for more details. 47 | 48 | You should have received a copy of the GNU Lesser General Public License 49 | along with this program. If not, see . 50 | -------------------------------------------------------------------------------- /csstidyphp/Docs/classtrees_csstidy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Class Trees for Package csstidy 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 |
csstidy
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 |
22 | 23 | 24 | 25 | 33 | 58 | 59 |
34 |
35 | 36 |

Class Trees for Package csstidy

37 |
38 |
Root class csstidy

39 | 41 | 42 |
43 |
Root class csstidy_optimise

44 | 46 | 47 |
48 |
Root class csstidy_print

49 | 51 | 52 |
53 |
54 | Documentation generated on Mon, 15 May 2006 22:54:54 +0200 by phpDocumentor 1.3.0RC3 55 |
56 |
57 |
60 | 61 | 62 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/font-face-atmedia-2.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test simple CSS print 3 | --CSS-- 4 | /** **/ 5 | @font-face { 6 | font-family: 'GenerikaRegular'; 7 | src: url('../fonts/generikaregular-webfont.eot'); 8 | src: url('../fonts/generikaregular-webfont.eot?#iefix') format('embedded-opentype'), 9 | url('../fonts/generikaregular-webfont.woff') format('woff'), 10 | url('../fonts/generikaregular-webfont.ttf') format('truetype'), 11 | url('../fonts/generikaregular-webfont.svg#GenerikaRegular') format('svg'); 12 | font-weight: normal; 13 | font-style: normal; 14 | } 15 | 16 | @font-face { 17 | font-family: 'GenerikaLight'; 18 | src: url('../fonts/generikalight-webfont.eot'); 19 | src: url('../fonts/generikalight-webfont.eot?#iefix') format('embedded-opentype'), 20 | url('../fonts/generikalight-webfont.woff') format('woff'), 21 | url('../fonts/generikalight-webfont.ttf') format('truetype'), 22 | url('../fonts/generikalight-webfont.svg#GenerikaLight') format('svg'); 23 | font-weight: normal; 24 | font-style: normal; 25 | } 26 | 27 | p { border: none;} 28 | 29 | --FULLEXPECT-- 30 | array( 31 | ' ' => array ( 32 | '@font-face' => 33 | array ( 34 | 'font-family' => '\'GenerikaRegular\'', 35 | 'src' => 'url(../fonts/generikaregular-webfont.eot)', 36 | 'src ' => 'url(../fonts/generikaregular-webfont.eot?#iefix) format("embedded-opentype"),url(../fonts/generikaregular-webfont.woff) format("woff"),url(../fonts/generikaregular-webfont.ttf) format("truetype"),url(../fonts/generikaregular-webfont.svg#GenerikaRegular) format("svg")', 37 | 'font-weight' => '400', 38 | 'font-style' => 'normal', 39 | ), 40 | '@font-face ' => 41 | array ( 42 | 'font-family' => '\'GenerikaLight\'', 43 | 'src' => 'url(../fonts/generikalight-webfont.eot)', 44 | 'src ' => 'url(../fonts/generikalight-webfont.eot?#iefix) format("embedded-opentype"),url(../fonts/generikalight-webfont.woff) format("woff"),url(../fonts/generikalight-webfont.ttf) format("truetype"),url(../fonts/generikalight-webfont.svg#GenerikaLight) format("svg")', 45 | 'font-weight' => '400', 46 | 'font-style' => 'normal', 47 | ), 48 | ), 49 | 41 => array ( 50 | 'p' => 51 | array ( 52 | 'border' => 'none', 53 | ), 54 | ), 55 | ) 56 | --SETTINGS-- 57 | sort_properties=false 58 | sort_selectors=false 59 | -------------------------------------------------------------------------------- /csstidyphp/Docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSSTidy Documentation 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 |
csstidy
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 |
22 | 23 | 24 | 25 | 51 | 64 | 65 |
52 |
53 | 54 |

CSSTidy Documentation

55 | Welcome to csstidy!
56 |
57 | This documentation was generated by phpDocumentor v1.3.0RC3
58 |
59 |
60 | Documentation generated on Mon, 15 May 2006 22:54:54 +0200 by phpDocumentor 1.3.0RC3 61 |
62 |
63 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /csstidyphp/Docs/li_csstidy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CSSTidy Documentation 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 |
csstidy
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 |
22 | 23 | 24 | 25 | 51 | 64 | 65 |
52 |
53 | 54 |

CSSTidy Documentation

55 | Welcome to csstidy!
56 |
57 | This documentation was generated by phpDocumentor v1.3.0RC3
58 |
59 |
60 | Documentation generated on Mon, 15 May 2006 22:54:53 +0200 by phpDocumentor 1.3.0RC3 61 |
62 |
63 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /csstidyphp/Docs/todolist.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Todo List 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 |
csstidy
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 |
22 | 23 | 24 | 25 | 34 | 73 | 74 |
35 |
36 | 37 |

Todo List

38 |

csstidy

39 |

$GLOBALS['csstidy']['all_properties']

40 |
    41 |
  • Add CSS3 properties
  • 42 |
43 |

$GLOBALS['csstidy']['background_prop_default']

44 |
    45 |
  • Possibly property names will change during CSS3 development
  • 46 |
47 |

$GLOBALS['csstidy']['color_values']

48 |
    49 |
  • CSS3 properties
  • 50 |
51 |

$GLOBALS['csstidy']['number_values']

52 |
    53 |
  • CSS3 properties
  • 54 |
55 |

$GLOBALS['csstidy']['shorthands']

56 |
    57 |
  • Are there new ones in CSS3?
  • 58 |
59 |

csstidy_optimise::dissolve_short_bg()

60 |
    61 |
  • full CSS 3 compliance
  • 62 |
63 |

csstidy_optimise::merge_bg()

64 |
    65 |
  • full CSS 3 compliance
  • 66 |
67 |
68 |
69 | Documentation generated on Mon, 15 May 2006 22:56:01 +0200 by phpDocumentor 1.3.0RC3 70 |
71 |
72 |
75 | 76 | 77 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/special/font-face.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | @font-face rules 3 | --CSS-- 4 | @font-face { 5 | font-family: GillSans; 6 | src:url("/generic/fonts/GillSansLightC.otf") format("opentype"); 7 | font-style: normal; 8 | font-weight: normal; 9 | } 10 | 11 | @font-face { 12 | font-family: GillSans; 13 | src:url("/generic/fonts/GillSansC.otf") format('opentype'); 14 | font-style: normal; 15 | font-weight: bold; 16 | } 17 | 18 | @font-face { 19 | src:url("/generic/fonts/GillSansLightC.otf") format("opentype", "woff"); 20 | } 21 | 22 | @font-face { 23 | src:url("/generic/fonts/GillSansLightC.otf") format(); 24 | } 25 | 26 | @font-face { 27 | src:url("/generic/fonts/GillSansLightC.otf") format("opentype" "svg"); 28 | } 29 | 30 | @font-face { 31 | src:url("/generic/fonts/GillSansLightC.otf") format("opentype", 'woff', 'svg'); 32 | } 33 | @font-face { 34 | src:url("/generic/fonts/GillSansLightC.otf") format(opentype); 35 | } 36 | @font-face { 37 | src:url("/generic/fonts/GillSansLightC.otf") format(opentype woff); 38 | } 39 | @font-face { 40 | src:url("/generic/fonts/GillSansLightC.otf") format(opentype, woff); 41 | } 42 | @font-face { 43 | src:url("/generic/fonts/GillSansLightC.otf") format(opentype, woff, "svg"); 44 | } 45 | @font-face { 46 | src:url("/generic/fonts/GillSansLightC.otf") format(opentype woff, "svg"); 47 | } 48 | @font-face { 49 | src:url("/generic/fonts/GillSans LightC.otf") format(opentype,woff); 50 | } 51 | --FULLEXPECT-- 52 | array ( 53 | ' ' => array( 54 | '@font-face' => 55 | array ( 56 | 'font-family' => 'GillSans', 57 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype")', 58 | 'font-style' => 'normal', 59 | 'font-weight' => '400', 60 | ), 61 | '@font-face ' => 62 | array ( 63 | 'font-family' => 'GillSans', 64 | 'src' => 'url(/generic/fonts/GillSansC.otf) format("opentype")', 65 | 'font-style' => 'normal', 66 | 'font-weight' => '700', 67 | ), 68 | '@font-face ' => 69 | array ( 70 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype","woff")', 71 | ), 72 | '@font-face ' => 73 | array ( 74 | 'src' => 'url(/generic/fonts/GillSansLightC.otf)', 75 | ), 76 | '@font-face ' => 77 | array ( 78 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype","svg")', 79 | ), 80 | '@font-face ' => 81 | array ( 82 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype","woff","svg")', 83 | ), 84 | '@font-face ' => 85 | array ( 86 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype")', 87 | ), 88 | '@font-face ' => 89 | array ( 90 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype","woff")', 91 | ), 92 | '@font-face ' => 93 | array ( 94 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype","woff")', 95 | ), 96 | '@font-face ' => 97 | array ( 98 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype","woff","svg")', 99 | ), 100 | '@font-face ' => 101 | array ( 102 | 'src' => 'url(/generic/fonts/GillSansLightC.otf) format("opentype","woff","svg")', 103 | ), 104 | '@font-face ' => 105 | array ( 106 | 'src' => 'url("/generic/fonts/GillSans LightC.otf") format("opentype","woff")', 107 | ), 108 | ), 109 | ) 110 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/properties/css1.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test CSS1 properties 3 | --CSS-- 4 | a { 5 | foo:rgb(0,0,0); 6 | bar:black; 7 | baz:#ffaabb; 8 | qux:#f00; 9 | quux:blanchedalmond; 10 | quuux:rgb(0,0,1); 11 | background:1; 12 | background-color:1; 13 | background-image:1; 14 | background-repeat:1; 15 | background-attachment:1; 16 | background-position:1; 17 | border:1; 18 | border-top:1; 19 | border-right:1; 20 | border-bottom:1; 21 | border-left:1; 22 | border-color:1; 23 | border-style:1; 24 | border-width:1; 25 | border-top-width:1; 26 | border-right-width:1; 27 | border-left-width:1; 28 | border-bottom-width:1; 29 | clear:1; 30 | clip:1; 31 | color:1; 32 | display:1; 33 | float:1; 34 | font:1; 35 | font-family:1; 36 | font-style:1; 37 | font-variant:1; 38 | font-weight:1; 39 | font-size:1; 40 | height:1; 41 | left:1; 42 | line-height:1; 43 | list-style:1; 44 | list-style-type:1; 45 | list-style-image:1; 46 | list-style-position:1; 47 | margin:1; 48 | margin-top:1; 49 | margin-right:1; 50 | margin-bottom:1; 51 | margin-left:1; 52 | marks:1; 53 | overflow:1; 54 | padding:1; 55 | padding-top:1; 56 | padding-right:1; 57 | padding-bottom:1; 58 | padding-left:1; 59 | page-break-before:1; 60 | page-break-after:1; 61 | position:1; 62 | size:1; 63 | top:1; 64 | text-indent:1; 65 | text-align:1; 66 | text-decoration:1; 67 | letter-spacing:1; 68 | word-spacing:1; 69 | text-transform:1; 70 | white-space:1; 71 | vertical-align:1; 72 | visibility:1; 73 | width:1; 74 | z-index:1; 75 | } 76 | --EXPECT-- 77 | array ( 78 | 'a' => 79 | array ( 80 | 'background' => '1px', 81 | 'background-color' => '#1', 82 | 'background-image' => '1', 83 | 'background-repeat' => '1', 84 | 'background-attachment' => '1', 85 | 'background-position' => '1px', 86 | 'border' => '1px', 87 | 'border-top' => '1px', 88 | 'border-right' => '1px', 89 | 'border-bottom' => '1px', 90 | 'border-left' => '1px', 91 | 'border-color' => '#1', 92 | 'border-style' => '1', 93 | 'border-width' => '1px', 94 | 'border-top-width' => '1px', 95 | 'border-right-width' => '1px', 96 | 'border-left-width' => '1px', 97 | 'border-bottom-width' => '1px', 98 | 'clear' => '1', 99 | 'color' => '#1', 100 | 'display' => '1', 101 | 'float' => '1', 102 | 'font' => '1', 103 | 'font-family' => '1', 104 | 'font-style' => '1', 105 | 'font-variant' => '1', 106 | 'font-weight' => '1', 107 | 'font-size' => '1px', 108 | 'height' => '1px', 109 | 'line-height' => '1', 110 | 'list-style' => '1', 111 | 'list-style-type' => '1', 112 | 'list-style-image' => '1', 113 | 'list-style-position' => '1', 114 | 'margin' => '1px', 115 | 'margin-top' => '1px', 116 | 'margin-right' => '1px', 117 | 'margin-bottom' => '1px', 118 | 'margin-left' => '1px', 119 | 'padding' => '1px', 120 | 'padding-top' => '1px', 121 | 'padding-right' => '1px', 122 | 'padding-bottom' => '1px', 123 | 'padding-left' => '1px', 124 | 'text-indent' => '1px', 125 | 'text-align' => '1', 126 | 'text-decoration' => '1', 127 | 'letter-spacing' => '1px', 128 | 'word-spacing' => '1px', 129 | 'text-transform' => '1', 130 | 'white-space' => '1', 131 | 'vertical-align' => '1', 132 | 'width' => '1px', 133 | ), 134 | ) 135 | --SETTINGS-- 136 | discard_invalid_properties=true 137 | optimise_shorthands=0 138 | css_level='CSS1' 139 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/class.csstidy_csst.php: -------------------------------------------------------------------------------- 1 | css[41] (no at block) */ 23 | var $expect = ''; 24 | 25 | /** Boolean whether or not to use $css->css instead for $expect */ 26 | var $fullexpect = false; 27 | 28 | /** Print form of CSS that can be tested **/ 29 | var $print = false; 30 | var $default_media = ""; 31 | 32 | /** Actual result */ 33 | var $actual; 34 | 35 | /** 36 | * Loads this class from a file. 37 | * @param $filename String filename to load 38 | */ 39 | function load($filename) { 40 | $this->filename = $filename; 41 | $fh = fopen($filename, 'r'); 42 | $state = ''; 43 | while (($line = fgets($fh)) !== false) { 44 | $line = rtrim($line, "\n\r"); // normalize newlines 45 | if (substr($line, 0, 2) == '--') { 46 | // detected section 47 | $state = $line; 48 | continue; 49 | } 50 | if ($state === null) continue; 51 | switch ($state) { 52 | case '--TEST--': 53 | $this->test = trim($line); 54 | break; 55 | case '--CSS--': 56 | $this->css .= $line . "\n"; 57 | break; 58 | case '--FULLEXPECT--': 59 | $this->fullexpect = true; 60 | $this->expect .= $line . "\n"; 61 | break; 62 | case '--EXPECT--': 63 | $this->expect .= $line . "\n"; 64 | break; 65 | case '--SETTINGS--': 66 | list($n, $v) = array_map('trim',explode('=', $line, 2)); 67 | $v = eval("return $v;"); 68 | if ($n=="default_media" AND $this->print) 69 | $this->default_media = $v; 70 | else 71 | $this->settings[$n] = $v; 72 | break; 73 | case '--PRINT--': 74 | $this->print = true; 75 | $this->expect .= $line . "\n"; 76 | break; 77 | } 78 | } 79 | if ($this->print) { 80 | $this->expect = trim($this->expect); 81 | } else { 82 | if ($this->expect) 83 | $this->expect = eval("return ".$this->expect.";"); 84 | if (!$this->fullexpect) 85 | $this->expect = array(41=>$this->expect); 86 | } 87 | fclose($fh); 88 | } 89 | 90 | /** 91 | * Implements SimpleExpectation::test(). 92 | * @param $filename Filename of test file to test. 93 | */ 94 | function test($filename = false) { 95 | if ($filename) $this->load($filename); 96 | $css = new csstidy(); 97 | $css->set_cfg($this->settings); 98 | $css->parse($this->css); 99 | if ($this->print) { 100 | $this->actual = $css->print->plain($this->default_media); 101 | } else { 102 | $this->actual = $css->css; 103 | } 104 | return $this->expect === $this->actual; 105 | } 106 | 107 | /** 108 | * Implements SimpleExpectation::testMessage(). 109 | */ 110 | function testMessage() { 111 | $message = $this->test . ' test at '. htmlspecialchars($this->filename); 112 | return $message; 113 | } 114 | 115 | /** 116 | * Renders the test with an HTML diff table. 117 | */ 118 | function render() { 119 | $message = '
'. htmlspecialchars($this->css) .'
'; 120 | $diff = new Text_Diff( 121 | 'auto', 122 | array( 123 | explode("\n", $this->print?$this->expect:var_export($this->expect,true)), 124 | explode("\n", $this->print?$this->actual:var_export($this->actual,true)) 125 | ) 126 | ); 127 | $renderer = new Text_Diff_Renderer_parallel(); 128 | $renderer->original = 'Expected'; 129 | $renderer->final = 'Actual'; 130 | $message .= $renderer->render($diff); 131 | return $message; 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /csstidyphp/Docs/csstidy/_class_csstidy_print_php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page class.csstidy_print.php 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 |
csstidy
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 |
22 | 23 | 24 | 25 | 51 | 93 | 94 |
52 |
53 | 54 |

Procedural File: class.csstidy_print.php

55 | Source Location: /class.csstidy_print.php

56 | 57 |
58 |
59 | 60 |
61 |

Classes:

62 |
csstidy_print
63 |
CSS Printing class
64 |


65 | 66 |

Page Details:

67 | CSSTidy - CSS Parser and Optimiser

CSS Printing class This class prints CSS data generated by 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




68 |

Tags:

69 |
70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
filesource:  Source Code for this file
author:  Florian Schmitz (floele at gmail dot com) 2005-2006
license:  GNU Public License
81 |
82 |

83 |

84 |

85 |
86 | 87 |
88 |
89 | Documentation generated on Mon, 15 May 2006 22:55:35 +0200 by phpDocumentor 1.3.0RC3 90 |
91 |
92 |
95 | 96 | 97 | -------------------------------------------------------------------------------- /csstidyphp/Docs/csstidy/_class_csstidy_optimise_php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page class.csstidy_optimise.php 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 |
csstidy
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 |
22 | 23 | 24 | 25 | 51 | 93 | 94 |
52 |
53 | 54 |

Procedural File: class.csstidy_optimise.php

55 | Source Location: /class.csstidy_optimise.php

56 | 57 |
58 |
59 | 60 |
61 |

Classes:

62 |
csstidy_optimise
63 |
CSS Optimising Class
64 |


65 | 66 |

Page Details:

67 | CSSTidy - CSS Parser and Optimiser

CSS Optimising Class This class optimises CSS data generated by 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




68 |

Tags:

69 |
70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
filesource:  Source Code for this file
author:  Florian Schmitz (floele at gmail dot com) 2005-2006
license:  GNU Public License
81 |
82 |

83 |

84 |

85 |
86 | 87 |
88 |
89 | Documentation generated on Mon, 15 May 2006 22:55:16 +0200 by phpDocumentor 1.3.0RC3 90 |
91 |
92 |
95 | 96 | 97 | -------------------------------------------------------------------------------- /csstidyphp/Docs/media/style.css: -------------------------------------------------------------------------------- 1 | .php { 2 | padding: 1em; 3 | } 4 | /* This will not be executed by IE, so now we have a fix! */ 5 | *[class="php-src"], *[class="php"], *[class="listing"] { 6 | line-height: 0px; 7 | } 8 | 9 | body 10 | { 11 | color: #000000; 12 | background-color: #ffffff; 13 | background-image: url("background.png"); 14 | background-repeat: repeat-y; 15 | font-family: tahoma, verdana, arial, sans-serif; 16 | font-size: 10pt; 17 | margin: 0; 18 | padding: 0; 19 | } 20 | 21 | a 22 | { 23 | color: #000099; 24 | background-color: transparent; 25 | text-decoration: none; 26 | } 27 | 28 | a:hover 29 | { 30 | text-decoration: underline; 31 | } 32 | 33 | a.menu 34 | { 35 | color: #ffffff; 36 | background-color: transparent; 37 | } 38 | 39 | td 40 | { 41 | font-size: 10pt; 42 | } 43 | 44 | td.header_top 45 | { 46 | color: #ffffff; 47 | background-color: #9999cc; 48 | font-size: 16pt; 49 | font-weight: bold; 50 | text-align: right; 51 | padding: 10px; 52 | } 53 | 54 | td.header_line 55 | { 56 | color: #ffffff; 57 | background-color: #333366; 58 | } 59 | 60 | td.header_menu 61 | { 62 | color: #ffffff; 63 | background-color: #666699; 64 | font-size: 8pt; 65 | text-align: right; 66 | padding: 2px; 67 | padding-right: 5px; 68 | } 69 | 70 | td.menu 71 | { 72 | padding: 2px; 73 | padding-left: 5px; 74 | } 75 | 76 | td.code_border 77 | { 78 | color: #000000; 79 | background-color: #c0c0c0; 80 | } 81 | 82 | td.code 83 | { 84 | color: #000000; 85 | background-color: #f0f0f0; 86 | } 87 | 88 | td.type 89 | { 90 | font-style: italic; 91 | } 92 | 93 | div.credit 94 | { 95 | font-size: 8pt; 96 | text-align: center; 97 | } 98 | 99 | div.package 100 | { 101 | padding-left: 5px; 102 | } 103 | 104 | div.tags 105 | { 106 | padding-left: 15px; 107 | } 108 | 109 | div.function 110 | { 111 | padding-left: 15px; 112 | } 113 | 114 | div.top 115 | { 116 | font-size: 8pt; 117 | } 118 | 119 | div.warning 120 | { 121 | color: #ff0000; 122 | background-color: transparent; 123 | } 124 | 125 | div.description 126 | { 127 | padding-left: 15px; 128 | } 129 | 130 | hr 131 | { 132 | height: 1px; 133 | border-style: solid; 134 | border-color: #c0c0c0; 135 | margin-top: 10px; 136 | margin-bottom: 10px; 137 | } 138 | 139 | span.smalllinenumber 140 | { 141 | font-size: 8pt; 142 | } 143 | 144 | ul { 145 | margin-left: 0px; 146 | padding-left: 8px; 147 | } 148 | /* Syntax highlighting */ 149 | 150 | .src-code { background-color: #f5f5f5; border: 1px solid #ccc9a4; padding: 0px; margin : 0px} 151 | /*.src-code pre { }*/ 152 | 153 | .src-comm { color: green; } 154 | .src-id { } 155 | .src-inc { color: #0000FF; } 156 | .src-key { color: #0000FF; } 157 | .src-num { color: #CC0000; } 158 | .src-str { color: #66cccc; } 159 | .src-sym { font-weight: bold; } 160 | .src-var { } 161 | 162 | .src-php { font-weight: bold; } 163 | 164 | .src-doc { color: #009999 } 165 | .src-doc-close-template { color: #0000FF } 166 | .src-doc-coretag { color: #0099FF; font-weight: bold } 167 | .src-doc-inlinetag { color: #0099FF } 168 | .src-doc-internal { color: #6699cc } 169 | .src-doc-tag { color: #0080CC } 170 | .src-doc-template { color: #0000FF } 171 | .src-doc-type { font-style: italic } 172 | .src-doc-var { font-style: italic } 173 | 174 | .tute-tag { color: #009999 } 175 | .tute-attribute-name { color: #0000FF } 176 | .tute-attribute-value { color: #0099FF } 177 | .tute-entity { font-weight: bold; } 178 | .tute-comment { font-style: italic } 179 | .tute-inline-tag { color: #636311; font-weight: bold } 180 | 181 | /* tutorial */ 182 | 183 | .authors { } 184 | .author { font-style: italic; font-weight: bold } 185 | .author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } 186 | .example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } 187 | .listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } 188 | .release-info { font-size: 85%; font-style: italic; margin: 1em 0em } 189 | .ref-title-box { } 190 | .ref-title { } 191 | .ref-purpose { font-style: italic; color: #666666 } 192 | .ref-synopsis { } 193 | .title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #9999CC } 194 | .cmd-synopsis { margin: 1em 0em } 195 | .cmd-title { font-weight: bold } 196 | .toc { margin-left: 2em; padding-left: 0em } 197 | 198 | -------------------------------------------------------------------------------- /csstidyphp/Docs/csstidy/_class_csstidy_php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page class.csstidy.php 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 |
csstidy
15 | [ class tree: csstidy ] 16 | [ index: csstidy ] 17 | [ all elements ] 18 |
22 | 23 | 24 | 25 | 51 | 126 | 127 |
52 |
53 | 54 |

Procedural File: class.csstidy.php

55 | Source Location: /class.csstidy.php

56 | 57 |
58 |
59 | 60 |
61 |

Classes:

62 |
csstidy
63 |
CSS Parser class
64 |


65 | 66 |

Page Details:

67 | CSSTidy - CSS Parser and Optimiser

CSS Parser class

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




68 |

Tags:

69 |
70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
filesource:  Source Code for this file
author:  Florian Schmitz (floele at gmail dot com) 2005-2006
license:  GNU Public License
81 |
82 |

83 |

Includes:

84 |
85 | require('data.inc.php') [line 33]
86 | Various CSS data needed for correct optimisations etc.



87 |

Tags:

88 |
89 | 90 | 91 | 92 | 93 |
version:  1.2
94 |
95 | require('class.csstidy_print.php') [line 40]
96 | Contains a class for printing CSS code



97 |

Tags:

98 |
99 | 100 | 101 | 102 | 103 |
version:  1.0
104 |
105 | require('class.csstidy_optimise.php') [line 47]
106 | Contains a class for optimising CSS code



107 |

Tags:

108 |
109 | 110 | 111 | 112 | 113 |
version:  1.0
114 |
115 |
116 |

117 |

118 |
119 | 120 |
121 |
122 | Documentation generated on Mon, 15 May 2006 22:54:54 +0200 by phpDocumentor 1.3.0RC3 123 |
124 |
125 |
128 | 129 | 130 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/properties/css21.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test CSS1 properties 3 | --CSS-- 4 | a { 5 | foo:rgb(0,0,0); 6 | bar:black; 7 | baz:#ffaabb; 8 | qux:#f00; 9 | quux:blanchedalmond; 10 | quuux:rgb(0,0,1); 11 | background:1; 12 | background-color:1; 13 | background-image:1; 14 | background-repeat:1; 15 | background-attachment:1; 16 | background-position:1; 17 | border:1; 18 | border-top:1; 19 | border-right:1; 20 | border-bottom:1; 21 | border-left:1; 22 | border-color:1; 23 | border-top-color:1; 24 | border-bottom-color:1; 25 | border-left-color:1; 26 | border-right-color:1; 27 | border-style:1; 28 | border-top-style:1; 29 | border-right-style:1; 30 | border-left-style:1; 31 | border-bottom-style:1; 32 | border-width:1; 33 | border-top-width:1; 34 | border-right-width:1; 35 | border-left-width:1; 36 | border-bottom-width:1; 37 | border-collapse:1; 38 | border-spacing:1; 39 | bottom:1; 40 | caption-side:1; 41 | content:1; 42 | clear:1; 43 | clip:1; 44 | color:1; 45 | counter-reset:1; 46 | counter-increment:1; 47 | cursor:1; 48 | empty-cells:1; 49 | display:1; 50 | direction:1; 51 | float:1; 52 | font:1; 53 | font-family:1; 54 | font-style:1; 55 | font-variant:1; 56 | font-weight:1; 57 | font-stretch:1; 58 | font-size-adjust:1; 59 | font-size:1; 60 | height:1; 61 | left:1; 62 | line-height:1; 63 | list-style:1; 64 | list-style-type:1; 65 | list-style-image:1; 66 | list-style-position:1; 67 | margin:1; 68 | margin-top:1; 69 | margin-right:1; 70 | margin-bottom:1; 71 | margin-left:1; 72 | marks:1; 73 | marker-offset:1; 74 | max-height:1; 75 | max-width:1; 76 | min-height:1; 77 | min-width:1; 78 | overflow:1; 79 | orphans:1; 80 | outline:1; 81 | outline-width:1; 82 | outline-style:1; 83 | outline-color:1; 84 | padding:1; 85 | padding-top:1; 86 | padding-right:1; 87 | padding-bottom:1; 88 | padding-left:1; 89 | page-break-before:1; 90 | page-break-after:1; 91 | page-break-inside:1; 92 | page:1; 93 | position:1; 94 | quotes:1; 95 | right:1; 96 | size:1; 97 | speak-header:1; 98 | table-layout:1; 99 | top:1; 100 | text-indent:1; 101 | text-align:1; 102 | text-decoration:1; 103 | text-shadow:1; 104 | letter-spacing:1; 105 | word-spacing:1; 106 | text-transform:1; 107 | white-space:1; 108 | unicode-bidi:1; 109 | vertical-align:1; 110 | visibility:1; 111 | width:1; 112 | widows:1; 113 | z-index:1; 114 | volume:1; 115 | speak:1; 116 | pause:1; 117 | pause-before:1; 118 | pause-after:1; 119 | cue:1; 120 | cue-before:1; 121 | cue-after:1; 122 | play-during:1; 123 | azimuth:1; 124 | elevation:1; 125 | speech-rate:1; 126 | voice-family:1; 127 | pitch:1; 128 | pitch-range:1; 129 | stress:1; 130 | richness:1; 131 | speak-punctuation:1; 132 | speak-numeral:1; 133 | } 134 | --EXPECT-- 135 | array ( 136 | 'a' => 137 | array ( 138 | 'background' => '1px', 139 | 'background-color' => '#1', 140 | 'background-image' => '1', 141 | 'background-repeat' => '1', 142 | 'background-attachment' => '1', 143 | 'background-position' => '1px', 144 | 'border' => '1px', 145 | 'border-top' => '1px', 146 | 'border-right' => '1px', 147 | 'border-bottom' => '1px', 148 | 'border-left' => '1px', 149 | 'border-color' => '#1', 150 | 'border-top-color' => '#1', 151 | 'border-bottom-color' => '#1', 152 | 'border-left-color' => '#1', 153 | 'border-right-color' => '#1', 154 | 'border-style' => '1', 155 | 'border-top-style' => '1', 156 | 'border-right-style' => '1', 157 | 'border-left-style' => '1', 158 | 'border-bottom-style' => '1', 159 | 'border-width' => '1px', 160 | 'border-top-width' => '1px', 161 | 'border-right-width' => '1px', 162 | 'border-left-width' => '1px', 163 | 'border-bottom-width' => '1px', 164 | 'border-collapse' => '1', 165 | 'border-spacing' => '1px', 166 | 'bottom' => '1px', 167 | 'caption-side' => '1', 168 | 'content' => '1', 169 | 'clear' => '1', 170 | 'clip' => '1', 171 | 'color' => '#1', 172 | 'counter-reset' => '1', 173 | 'counter-increment' => '1', 174 | 'cursor' => '1', 175 | 'empty-cells' => '1', 176 | 'display' => '1', 177 | 'direction' => '1', 178 | 'float' => '1', 179 | 'font' => '1', 180 | 'font-family' => '1', 181 | 'font-style' => '1', 182 | 'font-variant' => '1', 183 | 'font-weight' => '1', 184 | 'font-size' => '1px', 185 | 'height' => '1px', 186 | 'left' => '1px', 187 | 'line-height' => '1', 188 | 'list-style' => '1', 189 | 'list-style-type' => '1', 190 | 'list-style-image' => '1', 191 | 'list-style-position' => '1', 192 | 'margin' => '1px', 193 | 'margin-top' => '1px', 194 | 'margin-right' => '1px', 195 | 'margin-bottom' => '1px', 196 | 'margin-left' => '1px', 197 | 'max-height' => '1px', 198 | 'max-width' => '1px', 199 | 'min-height' => '1px', 200 | 'min-width' => '1px', 201 | 'overflow' => '1', 202 | 'orphans' => '1', 203 | 'outline' => '1px', 204 | 'outline-width' => '1px', 205 | 'outline-style' => '1', 206 | 'outline-color' => '#1', 207 | 'padding' => '1px', 208 | 'padding-top' => '1px', 209 | 'padding-right' => '1px', 210 | 'padding-bottom' => '1px', 211 | 'padding-left' => '1px', 212 | 'page-break-before' => '1', 213 | 'page-break-after' => '1', 214 | 'page-break-inside' => '1', 215 | 'position' => '1', 216 | 'quotes' => '1', 217 | 'right' => '1px', 218 | 'speak-header' => '1', 219 | 'table-layout' => '1', 220 | 'top' => '1px', 221 | 'text-indent' => '1px', 222 | 'text-align' => '1', 223 | 'text-decoration' => '1', 224 | 'letter-spacing' => '1px', 225 | 'word-spacing' => '1px', 226 | 'text-transform' => '1', 227 | 'white-space' => '1', 228 | 'unicode-bidi' => '1', 229 | 'vertical-align' => '1', 230 | 'visibility' => '1', 231 | 'width' => '1px', 232 | 'widows' => '1', 233 | 'z-index' => '1', 234 | 'volume' => '1', 235 | 'speak' => '1', 236 | 'pause' => '1', 237 | 'pause-before' => '1', 238 | 'pause-after' => '1', 239 | 'cue' => '1', 240 | 'cue-before' => '1', 241 | 'cue-after' => '1', 242 | 'play-during' => '1', 243 | 'azimuth' => '1', 244 | 'elevation' => '1', 245 | 'speech-rate' => '1', 246 | 'voice-family' => '1', 247 | 'pitch' => '1', 248 | 'pitch-range' => '1', 249 | 'stress' => '1', 250 | 'richness' => '1', 251 | 'speak-punctuation' => '1', 252 | 'speak-numeral' => '1', 253 | ), 254 | ) 255 | --SETTINGS-- 256 | discard_invalid_properties=true 257 | optimise_shorthands=0 258 | css_level='CSS2.1' -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/properties/css2.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test CSS1 properties 3 | --CSS-- 4 | a { 5 | foo:rgb(0,0,0); 6 | bar:black; 7 | baz:#ffaabb; 8 | qux:#f00; 9 | quux:blanchedalmond; 10 | quuux:rgb(0,0,1); 11 | background:1; 12 | background-color:1; 13 | background-image:1; 14 | background-repeat:1; 15 | background-attachment:1; 16 | background-position:1; 17 | border:1; 18 | border-top:1; 19 | border-right:1; 20 | border-bottom:1; 21 | border-left:1; 22 | border-color:1; 23 | border-top-color:1; 24 | border-bottom-color:1; 25 | border-left-color:1; 26 | border-right-color:1; 27 | border-style:1; 28 | border-top-style:1; 29 | border-right-style:1; 30 | border-left-style:1; 31 | border-bottom-style:1; 32 | border-width:1; 33 | border-top-width:1; 34 | border-right-width:1; 35 | border-left-width:1; 36 | border-bottom-width:1; 37 | border-collapse:1; 38 | border-spacing:1; 39 | bottom:1; 40 | caption-side:1; 41 | content:1; 42 | clear:1; 43 | clip:1; 44 | color:1; 45 | counter-reset:1; 46 | counter-increment:1; 47 | cursor:1; 48 | empty-cells:1; 49 | display:1; 50 | direction:1; 51 | float:1; 52 | font:1; 53 | font-family:1; 54 | font-style:1; 55 | font-variant:1; 56 | font-weight:1; 57 | font-stretch:1; 58 | font-size-adjust:1; 59 | font-size:1; 60 | height:1; 61 | left:1; 62 | line-height:1; 63 | list-style:1; 64 | list-style-type:1; 65 | list-style-image:1; 66 | list-style-position:1; 67 | margin:1; 68 | margin-top:1; 69 | margin-right:1; 70 | margin-bottom:1; 71 | margin-left:1; 72 | marks:1; 73 | marker-offset:1; 74 | max-height:1; 75 | max-width:1; 76 | min-height:1; 77 | min-width:1; 78 | overflow:1; 79 | orphans:1; 80 | outline:1; 81 | outline-width:1; 82 | outline-style:1; 83 | outline-color:1; 84 | padding:1; 85 | padding-top:1; 86 | padding-right:1; 87 | padding-bottom:1; 88 | padding-left:1; 89 | page-break-before:1; 90 | page-break-after:1; 91 | page-break-inside:1; 92 | page:1; 93 | position:1; 94 | quotes:1; 95 | right:1; 96 | size:1; 97 | speak-header:1; 98 | table-layout:1; 99 | top:1; 100 | text-indent:1; 101 | text-align:1; 102 | text-decoration:1; 103 | text-shadow:1; 104 | letter-spacing:1; 105 | word-spacing:1; 106 | text-transform:1; 107 | white-space:1; 108 | unicode-bidi:1; 109 | vertical-align:1; 110 | visibility:1; 111 | width:1; 112 | widows:1; 113 | z-index:1; 114 | volume:1; 115 | speak:1; 116 | pause:1; 117 | pause-before:1; 118 | pause-after:1; 119 | cue:1; 120 | cue-before:1; 121 | cue-after:1; 122 | play-during:1; 123 | azimuth:1; 124 | elevation:1; 125 | speech-rate:1; 126 | voice-family:1; 127 | pitch:1; 128 | pitch-range:1; 129 | stress:1; 130 | richness:1; 131 | speak-punctuation:1; 132 | speak-numeral:1; 133 | } 134 | --EXPECT-- 135 | array ( 136 | 'a' => 137 | array ( 138 | 'background' => '1px', 139 | 'background-color' => '#1', 140 | 'background-image' => '1', 141 | 'background-repeat' => '1', 142 | 'background-attachment' => '1', 143 | 'background-position' => '1px', 144 | 'border' => '1px', 145 | 'border-top' => '1px', 146 | 'border-right' => '1px', 147 | 'border-bottom' => '1px', 148 | 'border-left' => '1px', 149 | 'border-color' => '#1', 150 | 'border-top-color' => '#1', 151 | 'border-bottom-color' => '#1', 152 | 'border-left-color' => '#1', 153 | 'border-right-color' => '#1', 154 | 'border-style' => '1', 155 | 'border-top-style' => '1', 156 | 'border-right-style' => '1', 157 | 'border-left-style' => '1', 158 | 'border-bottom-style' => '1', 159 | 'border-width' => '1px', 160 | 'border-top-width' => '1px', 161 | 'border-right-width' => '1px', 162 | 'border-left-width' => '1px', 163 | 'border-bottom-width' => '1px', 164 | 'border-collapse' => '1', 165 | 'border-spacing' => '1px', 166 | 'bottom' => '1px', 167 | 'caption-side' => '1', 168 | 'content' => '1', 169 | 'clear' => '1', 170 | 'clip' => '1', 171 | 'color' => '#1', 172 | 'counter-reset' => '1', 173 | 'counter-increment' => '1', 174 | 'cursor' => '1', 175 | 'empty-cells' => '1', 176 | 'display' => '1', 177 | 'direction' => '1', 178 | 'float' => '1', 179 | 'font' => '1', 180 | 'font-family' => '1', 181 | 'font-style' => '1', 182 | 'font-variant' => '1', 183 | 'font-weight' => '1', 184 | 'font-stretch' => '1', 185 | 'font-size-adjust' => '1', 186 | 'font-size' => '1px', 187 | 'height' => '1px', 188 | 'left' => '1px', 189 | 'line-height' => '1', 190 | 'list-style' => '1', 191 | 'list-style-type' => '1', 192 | 'list-style-image' => '1', 193 | 'list-style-position' => '1', 194 | 'margin' => '1px', 195 | 'margin-top' => '1px', 196 | 'margin-right' => '1px', 197 | 'margin-bottom' => '1px', 198 | 'margin-left' => '1px', 199 | 'marks' => '1', 200 | 'marker-offset' => '1', 201 | 'max-height' => '1px', 202 | 'max-width' => '1px', 203 | 'min-height' => '1px', 204 | 'min-width' => '1px', 205 | 'overflow' => '1', 206 | 'orphans' => '1', 207 | 'outline' => '1px', 208 | 'outline-width' => '1px', 209 | 'outline-style' => '1', 210 | 'outline-color' => '#1', 211 | 'padding' => '1px', 212 | 'padding-top' => '1px', 213 | 'padding-right' => '1px', 214 | 'padding-bottom' => '1px', 215 | 'padding-left' => '1px', 216 | 'page-break-before' => '1', 217 | 'page-break-after' => '1', 218 | 'page-break-inside' => '1', 219 | 'page' => '1', 220 | 'position' => '1', 221 | 'quotes' => '1', 222 | 'right' => '1px', 223 | 'size' => '1', 224 | 'speak-header' => '1', 225 | 'table-layout' => '1', 226 | 'top' => '1px', 227 | 'text-indent' => '1px', 228 | 'text-align' => '1', 229 | 'text-decoration' => '1', 230 | 'text-shadow' => '1', 231 | 'letter-spacing' => '1px', 232 | 'word-spacing' => '1px', 233 | 'text-transform' => '1', 234 | 'white-space' => '1', 235 | 'unicode-bidi' => '1', 236 | 'vertical-align' => '1', 237 | 'visibility' => '1', 238 | 'width' => '1px', 239 | 'widows' => '1', 240 | 'z-index' => '1', 241 | 'volume' => '1', 242 | 'speak' => '1', 243 | 'pause' => '1', 244 | 'pause-before' => '1', 245 | 'pause-after' => '1', 246 | 'cue' => '1', 247 | 'cue-before' => '1', 248 | 'cue-after' => '1', 249 | 'play-during' => '1', 250 | 'azimuth' => '1', 251 | 'elevation' => '1', 252 | 'speech-rate' => '1', 253 | 'voice-family' => '1', 254 | 'pitch' => '1', 255 | 'pitch-range' => '1', 256 | 'stress' => '1', 257 | 'richness' => '1', 258 | 'speak-punctuation' => '1', 259 | 'speak-numeral' => '1', 260 | ), 261 | ) 262 | --SETTINGS-- 263 | discard_invalid_properties=true 264 | optimise_shorthands=0 265 | css_level='CSS2.0' -------------------------------------------------------------------------------- /csstidy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding: utf8 3 | # adapted from csstidy.py in the Sublime Text 1 webdevelopment package 4 | from os.path import join 5 | import subprocess 6 | import sublime 7 | import sublime_plugin 8 | 9 | 10 | ### CONSTANTS ### 11 | supported_options = [ 12 | "compress_colors", 13 | "compress_font-weight", 14 | "discard_invalid_properties", 15 | "discard_invalid_selectors", 16 | "lowercase_s", 17 | "preserve_css", 18 | "remove_bslash", 19 | "remove_last_;", 20 | "sort_properties", 21 | "sort_selectors", 22 | "timestamp", 23 | "merge_selectors", 24 | "case_properties", 25 | "optimise_shorthands", 26 | "template" 27 | ] 28 | 29 | ### COMMAND ## 30 | class CssTidyCommand(sublime_plugin.TextCommand): 31 | 32 | def run(self, edit, **args): 33 | # Get current selection(s). 34 | print('CSSTidy: tidying {0} with args: {1}'.format(self.view.file_name(), args)) 35 | 36 | self.packagepath = join(sublime.packages_path(), 'CSSTidy') 37 | self.scriptpath = join(self.packagepath, 'csstidy.php') 38 | self.startupinfo = None 39 | 40 | if sublime.platform() == 'windows': 41 | self.startupinfo = subprocess.STARTUPINFO() 42 | self.startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW 43 | self.startupinfo.wShowWindow = subprocess.SW_HIDE 44 | 45 | try: 46 | # executable will usually be "php". 47 | # If php isn't available, it will revert to "/win/csstidy.exe" on Windows 48 | executable = self.find_tidier() 49 | except OSError: 50 | print("CSSTidy: Couldn't find csstidy.exe or PHP. Stopping without Tidying anything.") 51 | return 52 | 53 | if self.view.sel()[0].empty(): 54 | # If no selection, get the entire view. 55 | self.view.sel().add(sublime.Region(0, self.view.size())) 56 | 57 | """ 58 | # If selection, then make sure not to add body tags and the like. 59 | # Not sure how to bring this into st2, or if it ever worked. 60 | 61 | if self.view.match_selector(0, 'source.css.embedded.html'): 62 | self.view.run_command('select_inside_tag') 63 | """ 64 | 65 | # Fetch arguments from prefs files. 66 | args = self.get_args(args, executable) 67 | 68 | shell = self.set_shell(executable) 69 | 70 | # Tidy each selection. 71 | for sel in self.view.sel(): 72 | #print('CSSTIdy: Sending this to Tidy:\n', self.view.substr(sel)) 73 | tidied, err, retval = self.tidy_string(self.view.substr(sel), args, shell) 74 | #print('CSSTIdy: Got these tidied styles back:\n', tidied) 75 | 76 | if err or retval != 0: 77 | print('CSSTidy returned {0}'.format(retval)) 78 | print("CSSTidy experienced an error. Opening up a new window to show you more.") 79 | 80 | # Again, adapted from the Sublime Text 1 webdevelopment package 81 | nv = self.view.window().new_file() 82 | 83 | # Append the given command to the error message. 84 | nv.insert(edit, 0, "{}\nCommand sent to Tidy:\n".format(err) + " ".join(x for x in args)) 85 | nv.set_name('CSSTidy Errors') 86 | 87 | else: 88 | if self.view.settings().get('translate_tabs_to_spaces'): 89 | tidied.replace("\t", self.space_tab) 90 | self.view.replace(edit, sel, tidied + "\n") 91 | return 92 | 93 | def set_shell(self, executable): 94 | if sublime.platform() == 'windows' and executable == 'php': 95 | return True 96 | return False 97 | 98 | def tidy_string(self, css, args, shell): 99 | print("CSSTidy: Sending command:" + " ".join(args)) 100 | 101 | p = subprocess.Popen( 102 | args, 103 | stdin=subprocess.PIPE, 104 | stdout=subprocess.PIPE, 105 | stderr=subprocess.PIPE, 106 | startupinfo=self.startupinfo, 107 | shell=shell 108 | ) 109 | 110 | # Encode to send to pipe, decode what's recieved from pipe 111 | tidied, err = p.communicate(css.encode('utf-8', 'backslashreplace')) 112 | tidied = tidied.decode('utf-8') 113 | 114 | return tidied, err, p.returncode 115 | 116 | def find_tidier(self): 117 | ' Try php, then bundled tidy (if windows)' 118 | 119 | try: 120 | subprocess.call(['php', '-v'], startupinfo=self.startupinfo) 121 | # print("CSSTidy: Using PHP CSSTidy module.") 122 | return 'php' 123 | except OSError: 124 | print("CSSTidy: PHP not found. Is it installed and in your PATH?") 125 | pass 126 | 127 | if sublime.platform() == 'windows': 128 | try: 129 | scriptpath = join(self.packagepath, 'win', 'csstidy.exe') 130 | subprocess.call([scriptpath, "-v"], startupinfo=self.startupinfo, shell=True) 131 | print("CSSTidy: using csstidy.exe") 132 | return scriptpath 133 | except OSError: 134 | print("CSSTidy: Didn't find tidy.exe in " + self.packagepath) 135 | pass 136 | 137 | raise OSError 138 | 139 | def get_args(self, passed_args, executable): 140 | '''Build command line arguments.''' 141 | 142 | settings = sublime.load_settings('CSSTidy.sublime-settings') 143 | csstidy_args = [executable] 144 | 145 | # print('CSSTidy: preserve css get:', settings.get("preserve_css")) 146 | 147 | # Start off with a dash, the flag for using STDIN 148 | # Set out file for csstidy.exe. PHP uses STDOUT 149 | if executable == 'php': 150 | csstidy_args.extend(['-f', self.scriptpath, '--']) 151 | else: 152 | csstidy_args.extend(['-', '--silent=1']) 153 | 154 | for option in supported_options: 155 | # If custom value isn't set, ignore that setting. 156 | if settings.get(option) is None and passed_args.get(option) is None: 157 | continue 158 | 159 | # The passed arguments override options in the settings file. 160 | value = passed_args.get(option) if passed_args.get(option) is not None else settings.get(option) 161 | 162 | # For some reason, csstidy.exe acts up less when passed numerals rather than booleans. 163 | if value in [True, 'true', 'True', 1]: 164 | value = '1' 165 | if value in [False, 'false', 'False', 0]: 166 | value = '0' 167 | 168 | if 'template' == option and value not in ['default', 'low', 'high', 'highest']: 169 | value = join(sublime.packages_path(), 'User', value) 170 | 171 | csstidy_args.append("--{0}={1}".format(option, value)) 172 | 173 | # Optionally replace tabs with spaces. 174 | if self.view.settings().get('translate_tabs_to_spaces'): 175 | self.space_tab = " " * int(self.view.settings().get('tab_size', 4)) 176 | 177 | return csstidy_args 178 | -------------------------------------------------------------------------------- /csstidyphp/class.csstidy_print.php: -------------------------------------------------------------------------------- 1 | . 25 | * 26 | * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License 27 | * @package csstidy 28 | * @author Florian Schmitz (floele at gmail dot com) 2005-2007 29 | * @author Brett Zamir (brettz9 at yahoo dot com) 2007 30 | * @author Cedric Morin (cedric at yterium dot com) 2010-2012 31 | */ 32 | 33 | /** 34 | * CSS Printing class 35 | * 36 | * This class prints CSS data generated by csstidy. 37 | * 38 | * @package csstidy 39 | * @author Florian Schmitz (floele at gmail dot com) 2005-2006 40 | * @version 1.1.0 41 | */ 42 | class csstidy_print { 43 | 44 | /** 45 | * csstidy object 46 | * @var object 47 | */ 48 | public $parser; 49 | 50 | /** 51 | * Saves the input CSS string 52 | * @var string 53 | * @access private 54 | */ 55 | public $input_css = ''; 56 | /** 57 | * Saves the formatted CSS string 58 | * @var string 59 | * @access public 60 | */ 61 | public $output_css = ''; 62 | /** 63 | * Saves the formatted CSS string (plain text) 64 | * @var string 65 | * @access public 66 | */ 67 | public $output_css_plain = ''; 68 | 69 | /** 70 | * Constructor 71 | * @param array $css contains the class csstidy 72 | * @access private 73 | * @version 1.0 74 | */ 75 | public function __construct($css) { 76 | $this->parser = $css; 77 | $this->css = & $css->css; 78 | $this->template = & $css->template; 79 | $this->tokens = & $css->tokens; 80 | $this->charset = & $css->charset; 81 | $this->import = & $css->import; 82 | $this->namespace = & $css->namespace; 83 | } 84 | 85 | /** 86 | * Resets output_css and output_css_plain (new css code) 87 | * @access private 88 | * @version 1.0 89 | */ 90 | public function _reset() { 91 | $this->output_css = ''; 92 | $this->output_css_plain = ''; 93 | } 94 | 95 | /** 96 | * Returns the CSS code as plain text 97 | * @param string $default_media default @media to add to selectors without any @media 98 | * @return string 99 | * @access public 100 | * @version 1.0 101 | */ 102 | public function plain($default_media='') { 103 | $this->_print(true, $default_media); 104 | return $this->output_css_plain; 105 | } 106 | 107 | /** 108 | * Returns the formatted CSS code 109 | * @param string $default_media default @media to add to selectors without any @media 110 | * @return string 111 | * @access public 112 | * @version 1.0 113 | */ 114 | public function formatted($default_media='') { 115 | $this->_print(false, $default_media); 116 | return $this->output_css; 117 | } 118 | 119 | /** 120 | * Returns the formatted CSS code to make a complete webpage 121 | * @param string $doctype shorthand for the document type 122 | * @param bool $externalcss indicates whether styles to be attached internally or as an external stylesheet 123 | * @param string $title title to be added in the head of the document 124 | * @param string $lang two-letter language code to be added to the output 125 | * @return string 126 | * @access public 127 | * @version 1.4 128 | */ 129 | public function formatted_page($doctype='html5', $externalcss=true, $title='', $lang='en') { 130 | switch ($doctype) { 131 | case 'html5': 132 | $doctype_output = ''; 133 | break; 134 | case 'xhtml1.0strict': 135 | $doctype_output = ''; 137 | break; 138 | case 'xhtml1.1': 139 | default: 140 | $doctype_output = ''; 142 | break; 143 | } 144 | 145 | $output = $cssparsed = ''; 146 | $this->output_css_plain = & $output; 147 | 148 | $output .= $doctype_output . "\n" . '' : ' lang="' . $lang . '">'; 150 | $output .= "\n\n $title"; 151 | 152 | if ($externalcss) { 153 | $output .= "\n "; 157 | } else { 158 | $output .= "\n" . ' '; 159 | } 160 | $output .= "\n\n"; 161 | $output .= $this->formatted(); 162 | $output .= '' . "\n" . ''; 163 | return $this->output_css_plain; 164 | } 165 | 166 | /** 167 | * Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain 168 | * @param bool $plain plain text or not 169 | * @param string $default_media default @media to add to selectors without any @media 170 | * @access private 171 | * @version 2.0 172 | */ 173 | public function _print($plain = false, $default_media='') { 174 | if ($this->output_css && $this->output_css_plain) { 175 | return; 176 | } 177 | 178 | $output = ''; 179 | if (!$this->parser->get_cfg('preserve_css')) { 180 | $this->_convert_raw_css($default_media); 181 | } 182 | 183 | $template = & $this->template; 184 | 185 | if ($plain) { 186 | $template = array_map('strip_tags', $template); 187 | } 188 | 189 | if ($this->parser->get_cfg('timestamp')) { 190 | array_unshift($this->tokens, array(COMMENT, ' CSSTidy ' . $this->parser->version . ': ' . date('r') . ' ')); 191 | } 192 | 193 | if (!empty($this->charset)) { 194 | $output .= $template[0] . '@charset ' . $template[5] . $this->charset . $template[6] . $template[13]; 195 | } 196 | 197 | if (!empty($this->import)) { 198 | for ($i = 0, $size = count($this->import); $i < $size; $i++) { 199 | if (substr($this->import[$i], 0, 4) === 'url(' && substr($this->import[$i], -1, 1) === ')') { 200 | $this->import[$i] = '"' . substr($this->import[$i], 4, -1) . '"'; 201 | $this->parser->log('Optimised @import : Removed "url("', 'Information'); 202 | } 203 | $output .= $template[0] . '@import ' . $template[5] . $this->import[$i] . $template[6] . $template[13]; 204 | } 205 | } 206 | 207 | if (!empty($this->namespace)) { 208 | if (($p=strpos($this->namespace,"url("))!==false && substr($this->namespace, -1, 1) === ')') { 209 | $this->namespace = substr_replace($this->namespace,'"',$p,4); 210 | $this->namespace = substr($this->namespace, 0, -1) . '"'; 211 | $this->parser->log('Optimised @namespace : Removed "url("', 'Information'); 212 | } 213 | $output .= $template[0] . '@namespace ' . $template[5] . $this->namespace . $template[6] . $template[13]; 214 | } 215 | 216 | $in_at_out = ''; 217 | $out = & $output; 218 | 219 | foreach ($this->tokens as $key => $token) { 220 | switch ($token[0]) { 221 | case AT_START: 222 | $out .= $template[0] . $this->_htmlsp($token[1], $plain) . $template[1]; 223 | $out = & $in_at_out; 224 | break; 225 | 226 | case SEL_START: 227 | if ($this->parser->get_cfg('lowercase_s')) 228 | $token[1] = strtolower($token[1]); 229 | $out .= ( $token[1]{0} !== '@') ? $template[2] . $this->_htmlsp($token[1], $plain) : $template[0] . $this->_htmlsp($token[1], $plain); 230 | $out .= $template[3]; 231 | break; 232 | 233 | case PROPERTY: 234 | if ($this->parser->get_cfg('case_properties') === 2) { 235 | $token[1] = strtoupper($token[1]); 236 | } elseif ($this->parser->get_cfg('case_properties') === 1) { 237 | $token[1] = strtolower($token[1]); 238 | } 239 | $out .= $template[4] . $this->_htmlsp($token[1], $plain) . ':' . $template[5]; 240 | break; 241 | 242 | case VALUE: 243 | $out .= $this->_htmlsp($token[1], $plain); 244 | if ($this->_seeknocomment($key, 1) == SEL_END && $this->parser->get_cfg('remove_last_;')) { 245 | $out .= str_replace(';', '', $template[6]); 246 | } else { 247 | $out .= $template[6]; 248 | } 249 | break; 250 | 251 | case SEL_END: 252 | $out .= $template[7]; 253 | if ($this->_seeknocomment($key, 1) != AT_END) 254 | $out .= $template[8]; 255 | break; 256 | 257 | case AT_END: 258 | $out = & $output; 259 | $out .= $template[10] . str_replace("\n", "\n" . $template[10], $in_at_out); 260 | $in_at_out = ''; 261 | $out .= $template[9]; 262 | break; 263 | 264 | case COMMENT: 265 | $out .= $template[11] . '/*' . $this->_htmlsp($token[1], $plain) . '*/' . $template[12]; 266 | break; 267 | } 268 | } 269 | 270 | $output = trim($output); 271 | 272 | if (!$plain) { 273 | $this->output_css = $output; 274 | $this->_print(true); 275 | } else { 276 | // If using spaces in the template, don't want these to appear in the plain output 277 | $this->output_css_plain = str_replace(' ', '', $output); 278 | } 279 | } 280 | 281 | /** 282 | * Gets the next token type which is $move away from $key, excluding comments 283 | * @param integer $key current position 284 | * @param integer $move move this far 285 | * @return mixed a token type 286 | * @access private 287 | * @version 1.0 288 | */ 289 | public function _seeknocomment($key, $move) { 290 | $go = ($move > 0) ? 1 : -1; 291 | for ($i = $key + 1; abs($key - $i) - 1 < abs($move); $i += $go) { 292 | if (!isset($this->tokens[$i])) { 293 | return; 294 | } 295 | if ($this->tokens[$i][0] == COMMENT) { 296 | $move += 1; 297 | continue; 298 | } 299 | return $this->tokens[$i][0]; 300 | } 301 | } 302 | 303 | /** 304 | * Converts $this->css array to a raw array ($this->tokens) 305 | * @param string $default_media default @media to add to selectors without any @media 306 | * @access private 307 | * @version 1.0 308 | */ 309 | public function _convert_raw_css($default_media='') { 310 | $this->tokens = array(); 311 | $sort_selectors = $this->parser->get_cfg('sort_selectors'); 312 | $sort_properties = $this->parser->get_cfg('sort_properties'); 313 | 314 | foreach ($this->css as $medium => $val) { 315 | if ($sort_selectors) 316 | ksort($val); 317 | if (intval($medium) < DEFAULT_AT) { 318 | // un medium vide (contenant @font-face ou autre @) ne produit aucun conteneur 319 | if (strlen(trim($medium))) { 320 | $this->parser->_add_token(AT_START, $medium, true); 321 | } 322 | } elseif ($default_media) { 323 | $this->parser->_add_token(AT_START, $default_media, true); 324 | } 325 | 326 | foreach ($val as $selector => $vali) { 327 | if ($sort_properties) 328 | ksort($vali); 329 | $this->parser->_add_token(SEL_START, $selector, true); 330 | 331 | $invalid = array( 332 | '*' => array(), // IE7 hacks first 333 | '_' => array(), // IE6 hacks 334 | '/' => array(), // IE6 hacks 335 | '-' => array() // IE6 hacks 336 | ); 337 | foreach ($vali as $property => $valj) { 338 | if (strncmp($property,"//",2)!==0) { 339 | $matches = array(); 340 | if ($sort_properties && preg_match('/^(\*|_|\/|-)(?!(ms|moz|o\b|xv|atsc|wap|khtml|webkit|ah|hp|ro|rim|tc)-)/', $property, $matches)) { 341 | $invalid[$matches[1]][$property] = $valj; 342 | } else { 343 | $this->parser->_add_token(PROPERTY, $property, true); 344 | $this->parser->_add_token(VALUE, $valj, true); 345 | } 346 | } 347 | } 348 | foreach ($invalid as $prefix => $props) { 349 | foreach ($props as $property => $valj) { 350 | $this->parser->_add_token(PROPERTY, $property, true); 351 | $this->parser->_add_token(VALUE, $valj, true); 352 | } 353 | } 354 | $this->parser->_add_token(SEL_END, $selector, true); 355 | } 356 | 357 | if (intval($medium) < DEFAULT_AT) { 358 | // un medium vide (contenant @font-face ou autre @) ne produit aucun conteneur 359 | if (strlen(trim($medium))) { 360 | $this->parser->_add_token(AT_END, $medium, true); 361 | } 362 | } elseif ($default_media) { 363 | $this->parser->_add_token(AT_END, $default_media, true); 364 | } 365 | } 366 | } 367 | 368 | /** 369 | * Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner. 370 | * @param string $string 371 | * @param bool $plain 372 | * @return string 373 | * @see csstidy_print::_print() 374 | * @access private 375 | * @version 1.0 376 | */ 377 | public function _htmlsp($string, $plain) { 378 | if (!$plain) { 379 | return htmlspecialchars($string, ENT_QUOTES, 'utf-8'); 380 | } 381 | return $string; 382 | } 383 | 384 | /** 385 | * Get compression ratio 386 | * @access public 387 | * @return float 388 | * @version 1.2 389 | */ 390 | public function get_ratio() { 391 | if (!$this->output_css_plain) { 392 | $this->formatted(); 393 | } 394 | return round((strlen($this->input_css) - strlen($this->output_css_plain)) / strlen($this->input_css), 3) * 100; 395 | } 396 | 397 | /** 398 | * Get difference between the old and new code in bytes and prints the code if necessary. 399 | * @access public 400 | * @return string 401 | * @version 1.1 402 | */ 403 | public function get_diff() { 404 | if (!$this->output_css_plain) { 405 | $this->formatted(); 406 | } 407 | 408 | $diff = strlen($this->output_css_plain) - strlen($this->input_css); 409 | 410 | if ($diff > 0) { 411 | return '+' . $diff; 412 | } elseif ($diff == 0) { 413 | return '+-' . $diff; 414 | } 415 | 416 | return $diff; 417 | } 418 | 419 | /** 420 | * Get the size of either input or output CSS in KB 421 | * @param string $loc default is "output" 422 | * @access public 423 | * @return integer 424 | * @version 1.0 425 | */ 426 | public function size($loc = 'output') { 427 | if ($loc === 'output' && !$this->output_css) { 428 | $this->formatted(); 429 | } 430 | 431 | if ($loc === 'input') { 432 | return (strlen($this->input_css) / 1000); 433 | } else { 434 | return (strlen($this->output_css_plain) / 1000); 435 | } 436 | } 437 | 438 | } 439 | -------------------------------------------------------------------------------- /csstidyphp/testing/unit-tests/csst/properties/css3.csst: -------------------------------------------------------------------------------- 1 | --TEST-- 2 | Test CSS1 properties 3 | --CSS-- 4 | a { 5 | foo:rgb(0,0,0); 6 | bar:black; 7 | baz:#ffaabb; 8 | qux:#f00; 9 | quux:blanchedalmond; 10 | quuux:rgb(0,0,1); 11 | alignment-adjust:1; 12 | alignment-baseline:1; 13 | animation:1; 14 | animation-delay:1; 15 | animation-direction:1; 16 | animation-duration:1; 17 | animation-iteration-count:1; 18 | animation-name:1; 19 | animation-play-state:1; 20 | animation-timing-function:1; 21 | appearance:1; 22 | azimuth:1; 23 | backface-visibility:1; 24 | background:1; 25 | background-attachment:1; 26 | background-clip:1; 27 | background-color:1; 28 | background-image:1; 29 | background-origin:1; 30 | background-position:1; 31 | background-repeat:1; 32 | background-size:1; 33 | baseline-shift:1; 34 | binding:1; 35 | bleed:1; 36 | bookmark-label:1; 37 | bookmark-level:1; 38 | bookmark-state:1; 39 | bookmark-target:1; 40 | border:1; 41 | border-bottom:1; 42 | border-bottom-color:1; 43 | border-bottom-left-radius:1; 44 | border-bottom-right-radius:1; 45 | border-bottom-style:1; 46 | border-bottom-width:1; 47 | border-collapse:1; 48 | border-color:1; 49 | border-image:1; 50 | border-image-outset:1; 51 | border-image-repeat:1; 52 | border-image-slice:1; 53 | border-image-source:1; 54 | border-image-width:1; 55 | border-left:1; 56 | border-left-color:1; 57 | border-left-style:1; 58 | border-left-width:1; 59 | border-radius:1; 60 | border-right:1; 61 | border-right-color:1; 62 | border-right-style:1; 63 | border-right-width:1; 64 | border-spacing:1; 65 | border-style:1; 66 | border-top:1; 67 | border-top-color:1; 68 | border-top-left-radius:1; 69 | border-top-right-radius:1; 70 | border-top-style:1; 71 | border-top-width:1; 72 | border-width:1; 73 | bottom:1; 74 | box-decoration-break:1; 75 | box-shadow:1; 76 | box-sizing:1; 77 | break-after:1; 78 | break-before:1; 79 | break-inside:1; 80 | caption-side:1; 81 | clear:1; 82 | clip:1; 83 | color:1; 84 | color-profile:1; 85 | column-count:1; 86 | column-fill:1; 87 | column-gap:1; 88 | column-rule:1; 89 | column-rule-color:1; 90 | column-rule-style:1; 91 | column-rule-width:1; 92 | column-span:1; 93 | column-width:1; 94 | columns:1; 95 | content:1; 96 | counter-increment:1; 97 | counter-reset:1; 98 | crop:1; 99 | cue:1; 100 | cue-after:1; 101 | cue-before:1; 102 | cursor:1; 103 | direction:1; 104 | display:1; 105 | dominant-baseline:1; 106 | drop-initial-after-adjust:1; 107 | drop-initial-after-align:1; 108 | drop-initial-before-adjust:1; 109 | drop-initial-before-align:1; 110 | drop-initial-size:1; 111 | drop-initial-value:1; 112 | elevation:1; 113 | empty-cells:1; 114 | fit:1; 115 | fit-position:1; 116 | flex-align:1; 117 | flex-flow:1; 118 | flex-line-pack:1; 119 | flex-order:1; 120 | flex-pack:1; 121 | float:1; 122 | float-offset:1; 123 | font:1; 124 | font-family:1; 125 | font-size:1; 126 | font-size-adjust:1; 127 | font-stretch:1; 128 | font-style:1; 129 | font-variant:1; 130 | font-weight:1; 131 | grid-columns:1; 132 | grid-rows:1; 133 | hanging-punctuation:1; 134 | height:1; 135 | hyphenate-after:1; 136 | hyphenate-before:1; 137 | hyphenate-character:1; 138 | hyphenate-lines:1; 139 | hyphenate-resource:1; 140 | hyphens:1; 141 | icon:1; 142 | image-orientation:1; 143 | image-rendering:1; 144 | image-resolution:1; 145 | inline-box-align:1; 146 | left:1; 147 | letter-spacing:1; 148 | line-break:1; 149 | line-height:1; 150 | line-stacking:1; 151 | line-stacking-ruby:1; 152 | line-stacking-shift:1; 153 | line-stacking-strategy:1; 154 | list-style:1; 155 | list-style-image:1; 156 | list-style-position:1; 157 | list-style-type:1; 158 | margin:1; 159 | margin-bottom:1; 160 | margin-left:1; 161 | margin-right:1; 162 | margin-top:1; 163 | marker-offset:1; 164 | marks:1; 165 | marquee-direction:1; 166 | marquee-loop:1; 167 | marquee-play-count:1; 168 | marquee-speed:1; 169 | marquee-style:1; 170 | max-height:1; 171 | max-width:1; 172 | min-height:1; 173 | min-width:1; 174 | move-to:1; 175 | nav-down:1; 176 | nav-index:1; 177 | nav-left:1; 178 | nav-right:1; 179 | nav-up:1; 180 | opacity:1; 181 | orphans:1; 182 | outline:1; 183 | outline-color:1; 184 | outline-offset:1; 185 | outline-style:1; 186 | outline-width:1; 187 | overflow:1; 188 | overflow-style:1; 189 | overflow-wrap:1; 190 | overflow-x:1; 191 | overflow-y:1; 192 | padding:1; 193 | padding-bottom:1; 194 | padding-left:1; 195 | padding-right:1; 196 | padding-top:1; 197 | page:1; 198 | page-break-after:1; 199 | page-break-before:1; 200 | page-break-inside:1; 201 | page-policy:1; 202 | pause:1; 203 | pause-after:1; 204 | pause-before:1; 205 | perspective:1; 206 | perspective-origin:1; 207 | phonemes:1; 208 | pitch:1; 209 | pitch-range:1; 210 | play-during:1; 211 | position:1; 212 | presentation-level:1; 213 | punctuation-trim:1; 214 | quotes:1; 215 | rendering-intent:1; 216 | resize:1; 217 | rest:1; 218 | rest-after:1; 219 | rest-before:1; 220 | richness:1; 221 | right:1; 222 | rotation:1; 223 | rotation-point:1; 224 | ruby-align:1; 225 | ruby-overhang:1; 226 | ruby-position:1; 227 | ruby-span:1; 228 | size:1; 229 | speak:1; 230 | speak-header:1; 231 | speak-numeral:1; 232 | speak-punctuation:1; 233 | speech-rate:1; 234 | src:1; 235 | stress:1; 236 | string-set:1; 237 | tab-size:1; 238 | table-layout:1; 239 | target:1; 240 | target-name:1; 241 | target-new:1; 242 | target-position:1; 243 | text-align:1; 244 | text-align-last:1; 245 | text-decoration:1; 246 | text-decoration-color:1; 247 | text-decoration-line:1; 248 | text-decoration-skip:1; 249 | text-decoration-style:1; 250 | text-emphasis:1; 251 | text-emphasis-color:1; 252 | text-emphasis-position:1; 253 | text-emphasis-style:1; 254 | text-height:1; 255 | text-indent:1; 256 | text-justify:1; 257 | text-outline:1; 258 | text-shadow:1; 259 | text-space-collapse:1; 260 | text-transform:1; 261 | text-underline-position:1; 262 | text-wrap:1; 263 | top:1; 264 | transform:1; 265 | transform-origin:1; 266 | transform-style:1; 267 | transition:1; 268 | transition-delay:1; 269 | transition-duration:1; 270 | transition-property:1; 271 | transition-timing-function:1; 272 | unicode-bidi:1; 273 | vertical-align:1; 274 | visibility:1; 275 | voice-balance:1; 276 | voice-duration:1; 277 | voice-family:1; 278 | voice-pitch:1; 279 | voice-pitch-range:1; 280 | voice-rate:1; 281 | voice-stress:1; 282 | voice-volume:1; 283 | volume:1; 284 | white-space:1; 285 | widows:1; 286 | width:1; 287 | word-break:1; 288 | word-spacing:1; 289 | word-wrap:1; 290 | z-index:1; 291 | } 292 | --EXPECT-- 293 | array ( 294 | 'a' => 295 | array ( 296 | 'alignment-adjust' => '1', 297 | 'alignment-baseline' => '1', 298 | 'animation' => '1', 299 | 'animation-delay' => '1', 300 | 'animation-direction' => '1', 301 | 'animation-duration' => '1', 302 | 'animation-iteration-count' => '1', 303 | 'animation-name' => '1', 304 | 'animation-play-state' => '1', 305 | 'animation-timing-function' => '1', 306 | 'appearance' => '1', 307 | 'azimuth' => '1', 308 | 'backface-visibility' => '1', 309 | 'background' => '1px', 310 | 'background-attachment' => '1', 311 | 'background-clip' => '1', 312 | 'background-color' => '#1', 313 | 'background-image' => '1', 314 | 'background-origin' => '1', 315 | 'background-position' => '1px', 316 | 'background-repeat' => '1', 317 | 'background-size' => '1px', 318 | 'baseline-shift' => '1', 319 | 'binding' => '1', 320 | 'bleed' => '1', 321 | 'bookmark-label' => '1', 322 | 'bookmark-level' => '1', 323 | 'bookmark-state' => '1', 324 | 'bookmark-target' => '1', 325 | 'border' => '1px', 326 | 'border-bottom' => '1px', 327 | 'border-bottom-color' => '#1', 328 | 'border-bottom-left-radius' => '1', 329 | 'border-bottom-right-radius' => '1', 330 | 'border-bottom-style' => '1', 331 | 'border-bottom-width' => '1px', 332 | 'border-collapse' => '1', 333 | 'border-color' => '#1', 334 | 'border-image' => '1', 335 | 'border-image-outset' => '1', 336 | 'border-image-repeat' => '1', 337 | 'border-image-slice' => '1', 338 | 'border-image-source' => '1', 339 | 'border-image-width' => '1', 340 | 'border-left' => '1px', 341 | 'border-color' => '#1', 342 | 'border-bottom-color' => '#1', 343 | 'border-left-color' => '#1', 344 | 'border-left-style' => '1', 345 | 'border-left-width' => '1px', 346 | 'border-radius' => '1', 347 | 'border-right' => '1px', 348 | 'border-right-color' => '#1', 349 | 'border-right-style' => '1', 350 | 'border-right-style' => '1', 351 | 'border-right-width' => '1px', 352 | 'border-spacing' => '1px', 353 | 'border-style' => '1', 354 | 'border-top' => '1px', 355 | 'border-top-color' => '#1', 356 | 'border-top-left-radius' => '1', 357 | 'border-top-right-radius' => '1', 358 | 'border-top-style' => '1', 359 | 'border-left-style' => '1', 360 | 'border-bottom-style' => '1', 361 | 'border-top-width' => '1px', 362 | 'border-width' => '1px', 363 | 'border-right-width' => '1px', 364 | 'border-left-width' => '1px', 365 | 'border-bottom-width' => '1px', 366 | 'border-collapse' => '1', 367 | 'border-spacing' => '1px', 368 | 'bottom' => '1px', 369 | 'box-decoration-break' => '1', 370 | 'box-shadow' => '1', 371 | 'box-sizing' => '1', 372 | 'break-after' => '1', 373 | 'break-before' => '1', 374 | 'break-inside' => '1', 375 | 'caption-side' => '1', 376 | 'clear' => '1', 377 | 'clip' => '1', 378 | 'color' => '#1', 379 | 'color-profile' => '1', 380 | 'column-count' => '1', 381 | 'column-fill' => '1', 382 | 'column-gap' => '1px', 383 | 'column-rule' => '1', 384 | 'column-rule-color' => '#1', 385 | 'column-rule-style' => '1', 386 | 'column-rule-width' => '1', 387 | 'column-span' => '1', 388 | 'column-width' => '1px', 389 | 'columns' => '1', 390 | 'content' => '1', 391 | 'counter-increment' => '1', 392 | 'counter-reset' => '1', 393 | 'crop' => '1', 394 | 'cue' => '1', 395 | 'cue-after' => '1', 396 | 'cue-before' => '1', 397 | 'cursor' => '1', 398 | 'direction' => '1', 399 | 'display' => '1', 400 | 'dominant-baseline' => '1', 401 | 'drop-initial-after-adjust' => '1', 402 | 'drop-initial-after-align' => '1', 403 | 'drop-initial-before-adjust' => '1', 404 | 'drop-initial-before-align' => '1', 405 | 'drop-initial-size' => '1', 406 | 'drop-initial-value' => '1', 407 | 'elevation' => '1', 408 | 'empty-cells' => '1', 409 | 'fit' => '1', 410 | 'fit-position' => '1', 411 | 'flex-align' => '1', 412 | 'flex-flow' => '1', 413 | 'flex-line-pack' => '1', 414 | 'flex-order' => '1', 415 | 'flex-pack' => '1', 416 | 'float' => '1', 417 | 'float-offset' => '1', 418 | 'font' => '1', 419 | 'font-family' => '1', 420 | 'font-size' => '1px', 421 | 'font-size-adjust' => '1', 422 | 'font-stretch' => '1', 423 | 'font-style' => '1', 424 | 'font-variant' => '1', 425 | 'font-weight' => '1', 426 | 'grid-columns' => '1', 427 | 'grid-rows' => '1', 428 | 'hanging-punctuation' => '1', 429 | 'height' => '1px', 430 | 'hyphenate-after' => '1', 431 | 'hyphenate-before' => '1', 432 | 'hyphenate-character' => '1', 433 | 'hyphenate-lines' => '1', 434 | 'hyphenate-resource' => '1', 435 | 'hyphens' => '1', 436 | 'icon' => '1', 437 | 'image-orientation' => '1', 438 | 'image-rendering' => '1', 439 | 'image-resolution' => '1', 440 | 'inline-box-align' => '1', 441 | 'left' => '1px', 442 | 'letter-spacing' => '1px', 443 | 'line-break' => '1', 444 | 'line-height' => '1', 445 | 'line-stacking' => '1', 446 | 'line-stacking-ruby' => '1', 447 | 'line-stacking-shift' => '1', 448 | 'line-stacking-strategy' => '1', 449 | 'list-style' => '1', 450 | 'list-style-image' => '1', 451 | 'list-style-position' => '1', 452 | 'list-style-type' => '1', 453 | 'margin' => '1px', 454 | 'margin-bottom' => '1px', 455 | 'margin-left' => '1px', 456 | 'margin-right' => '1px', 457 | 'margin-top' => '1px', 458 | 'marker-offset' => '1', 459 | 'marks' => '1', 460 | 'marquee-direction' => '1', 461 | 'marquee-loop' => '1', 462 | 'marquee-play-count' => '1', 463 | 'marquee-speed' => '1', 464 | 'marquee-style' => '1', 465 | 'max-height' => '1px', 466 | 'max-width' => '1px', 467 | 'min-height' => '1px', 468 | 'min-width' => '1px', 469 | 'move-to' => '1', 470 | 'nav-down' => '1', 471 | 'nav-index' => '1', 472 | 'nav-left' => '1', 473 | 'nav-right' => '1', 474 | 'nav-up' => '1', 475 | 'opacity' => '1', 476 | 'orphans' => '1', 477 | 'outline' => '1px', 478 | 'outline-color' => '#1', 479 | 'outline-offset' => '1', 480 | 'outline-style' => '1', 481 | 'outline-width' => '1px', 482 | 'overflow' => '1', 483 | 'overflow-style' => '1', 484 | 'overflow-wrap' => '1', 485 | 'overflow-x' => '1', 486 | 'overflow-y' => '1', 487 | 'padding' => '1px', 488 | 'padding-bottom' => '1px', 489 | 'padding-left' => '1px', 490 | 'padding-right' => '1px', 491 | 'padding-top' => '1px', 492 | 'page' => '1', 493 | 'page-break-after' => '1', 494 | 'page-break-before' => '1', 495 | 'page-break-inside' => '1', 496 | 'page-policy' => '1', 497 | 'pause' => '1', 498 | 'pause-after' => '1', 499 | 'pause-before' => '1', 500 | 'perspective' => '1px', 501 | 'perspective-origin' => '1', 502 | 'phonemes' => '1', 503 | 'pitch' => '1', 504 | 'pitch-range' => '1', 505 | 'play-during' => '1', 506 | 'position' => '1', 507 | 'presentation-level' => '1', 508 | 'punctuation-trim' => '1', 509 | 'quotes' => '1', 510 | 'rendering-intent' => '1', 511 | 'resize' => '1', 512 | 'rest' => '1', 513 | 'rest-after' => '1', 514 | 'rest-before' => '1', 515 | 'richness' => '1', 516 | 'right' => '1px', 517 | 'rotation' => '1', 518 | 'rotation-point' => '1', 519 | 'ruby-align' => '1', 520 | 'ruby-overhang' => '1', 521 | 'ruby-position' => '1', 522 | 'ruby-span' => '1', 523 | 'size' => '1', 524 | 'speak' => '1', 525 | 'speak-header' => '1', 526 | 'speak-numeral' => '1', 527 | 'speak-punctuation' => '1', 528 | 'speech-rate' => '1', 529 | 'src' => '1', 530 | 'stress' => '1', 531 | 'string-set' => '1', 532 | 'tab-size' => '1', 533 | 'table-layout' => '1', 534 | 'target' => '1', 535 | 'target-name' => '1', 536 | 'target-new' => '1', 537 | 'target-position' => '1', 538 | 'text-align' => '1', 539 | 'text-align-last' => '1', 540 | 'text-decoration' => '1', 541 | 'text-decoration-color' => '1', 542 | 'text-decoration-line' => '1', 543 | 'text-decoration-skip' => '1', 544 | 'text-decoration-style' => '1', 545 | 'text-emphasis' => '1', 546 | 'text-emphasis-color' => '1', 547 | 'text-emphasis-position' => '1', 548 | 'text-emphasis-style' => '1', 549 | 'text-height' => '1', 550 | 'text-indent' => '1px', 551 | 'text-justify' => '1', 552 | 'text-outline' => '1', 553 | 'text-shadow' => '1', 554 | 'text-space-collapse' => '1', 555 | 'letter-spacing' => '1px', 556 | 'text-transform' => '1', 557 | 'text-underline-position' => '1', 558 | 'text-wrap' => '1', 559 | 'top' => '1px', 560 | 'transform' => '1', 561 | 'transform-origin' => '1', 562 | 'transform-style' => '1', 563 | 'transition' => '1', 564 | 'transition-delay' => '1', 565 | 'transition-duration' => '1', 566 | 'transition-property' => '1', 567 | 'transition-timing-function' => '1', 568 | 'unicode-bidi' => '1', 569 | 'vertical-align' => '1', 570 | 'visibility' => '1', 571 | 'voice-balance' => '1', 572 | 'voice-duration' => '1', 573 | 'voice-family' => '1', 574 | 'voice-pitch' => '1', 575 | 'voice-pitch-range' => '1', 576 | 'voice-rate' => '1', 577 | 'voice-stress' => '1', 578 | 'voice-volume' => '1', 579 | 'volume' => '1', 580 | 'white-space' => '1', 581 | 'widows' => '1', 582 | 'width' => '1px', 583 | 'word-break' => '1', 584 | 'word-spacing' => '1px', 585 | 'word-wrap' => '1', 586 | 'z-index' => '1', 587 | ), 588 | ) 589 | --SETTINGS-- 590 | discard_invalid_properties=true 591 | optimise_shorthands=0 592 | css_level='CSS3.0' -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 675 Mass Ave, Cambridge, MA 02139, USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | -------------------------------------------------------------------------------- /csstidyphp/lang.inc.php: -------------------------------------------------------------------------------- 1 | . 22 | * 23 | * @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License 24 | * @package csstidy 25 | * @author Florian Schmitz (floele at gmail dot com) 2005-2007 26 | * @author Brett Zamir (brettz9 at yahoo dot com) 2007 27 | */ 28 | 29 | 30 | if (isset($_GET['lang'])) { 31 | $l = $_GET['lang']; 32 | } elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { 33 | $l = $_SERVER['HTTP_ACCEPT_LANGUAGE']; 34 | $l = strtolower(substr($l, 0, 2)); 35 | } else { 36 | $l = ''; 37 | } 38 | 39 | $l = (in_array($l, array('de', 'fr', 'zh'))) ? $l : 'en'; 40 | 41 | // note 5 in all but French, and 40 in all are orphaned 42 | 43 | $lang = array(); 44 | $lang['en'][0] = 'CSS Formatter and Optimiser/Optimizer (based on CSSTidy '; 45 | $lang['en'][1] = 'CSS Formatter and Optimiser'; 46 | $lang['en'][2] = '(based on'; 47 | $lang['en'][3] = '(plaintext)'; 48 | $lang['en'][4] = 'Important Note:'; 49 | $lang['en'][6] = 'Your code should be well-formed. This is not a validator which points out errors in your CSS code. To make sure that your code is valid, use the W3C Validator.'; 50 | $lang['en'][7] = 'all comments are removed'; 51 | $lang['en'][8] = 'CSS Input:'; 52 | $lang['en'][9] = 'CSS-Code:'; 53 | $lang['en'][10] = 'CSS from URL:'; 54 | $lang['en'][11] = 'Code Layout:'; 55 | $lang['en'][12] = 'Compression (code layout):'; 56 | $lang['en'][13] = 'Highest (no readability, smallest size)'; 57 | $lang['en'][14] = 'High (moderate readability, smaller size)'; 58 | $lang['en'][15] = 'Standard (balance between readability and size)'; 59 | $lang['en'][16] = 'Low (higher readability)'; 60 | $lang['en'][17] = 'Custom (enter below)'; 61 | $lang['en'][18] = 'Custom template'; 62 | $lang['en'][19] = 'Options'; 63 | $lang['en'][20] = 'Sort Selectors (caution)'; 64 | $lang['en'][21] = 'Sort Properties'; 65 | $lang['en'][22] = 'Regroup selectors'; 66 | $lang['en'][23] = 'Optimise shorthands'; 67 | $lang['en'][24] = 'Compress colors'; 68 | $lang['en'][25] = 'Lowercase selectors'; 69 | $lang['en'][26] = 'Case for properties:'; 70 | $lang['en'][27] = 'Lowercase'; 71 | $lang['en'][28] = 'No or invalid CSS input or wrong URL!'; 72 | $lang['en'][29] = 'Uppercase'; 73 | $lang['en'][30] = 'lowercase elementnames needed for XHTML'; 74 | $lang['en'][31] = 'Remove unnecessary backslashes'; 75 | $lang['en'][32] = 'convert !important-hack'; 76 | $lang['en'][33] = 'Output as file'; 77 | $lang['en'][34] = 'Bigger compression because of smaller newlines (copy & paste doesn\'t work)'; 78 | $lang['en'][35] = 'Process CSS'; 79 | $lang['en'][36] = 'Compression Ratio'; 80 | $lang['en'][37] = 'Input'; 81 | $lang['en'][38] = 'Output'; 82 | $lang['en'][39] = 'Language'; 83 | $lang['en'][41] = 'Attention: This may change the behaviour of your CSS Code!'; 84 | $lang['en'][42] = 'Remove last ;'; 85 | $lang['en'][43] = 'Discard invalid properties'; 86 | $lang['en'][44] = 'Only safe optimisations'; 87 | $lang['en'][45] = 'Compress font-weight'; 88 | $lang['en'][46] = 'Save comments'; 89 | $lang['en'][47] = 'Do not change anything'; 90 | $lang['en'][48] = 'Only seperate selectors (split at ,)'; 91 | $lang['en'][49] = 'Merge selectors with the same properties (fast)'; 92 | $lang['en'][50] = 'Merge selectors intelligently (slow)'; 93 | $lang['en'][51] = 'Preserve CSS'; 94 | $lang['en'][52] = 'Save comments, hacks, etc. Most optimisations can *not* be applied if this is enabled.'; 95 | $lang['en'][53] = 'None'; 96 | $lang['en'][54] = 'Don\'t optimise'; 97 | $lang['en'][55] = 'Safe optimisations'; 98 | $lang['en'][56] = 'All optimisations'; 99 | $lang['en'][57] = 'Add timestamp'; 100 | $lang['en'][58] = 'Copy to clipboard'; 101 | $lang['en'][59] = 'Back to top'; 102 | $lang['en'][60] = 'Your browser doesn\'t support copy to clipboard.'; 103 | $lang['en'][61] = 'For bugs and suggestions feel free to'; 104 | $lang['en'][62] = 'contact me'; 105 | $lang['en'][63] = 'Output CSS code as complete HTML document'; 106 | $lang['en'][64] = 'Code'; 107 | $lang['en'][65] = 'CSS to style CSS output'; 108 | $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.'; 109 | 110 | 111 | $lang['de'][0] = 'CSS Formatierer und Optimierer (basierend auf CSSTidy '; 112 | $lang['de'][1] = 'CSS Formatierer und Optimierer'; 113 | $lang['de'][2] = '(basierend auf'; 114 | $lang['de'][3] = '(Textversion)'; 115 | $lang['de'][4] = 'Wichtiger Hinweis:'; 116 | $lang['de'][6] = 'Der CSS Code sollte wohlgeformt sein. Der CSS Code wird nicht auf Gültigkeit überprüft. Um sicherzugehen dass dein Code valide ist, benutze den W3C Validierungsservice.'; 117 | $lang['de'][7] = 'alle Kommentare werden entfernt'; 118 | $lang['de'][8] = 'CSS Eingabe:'; 119 | $lang['de'][9] = 'CSS-Code:'; 120 | $lang['de'][10] = 'CSS von URL:'; 121 | $lang['de'][11] = 'Code Layout:'; 122 | $lang['de'][12] = 'Komprimierung (Code Layout):'; 123 | $lang['de'][13] = 'Höchste (keine Lesbarkeit, niedrigste Größe)'; 124 | $lang['de'][14] = 'Hoch (mittelmäßige Lesbarkeit, geringe Größe)'; 125 | $lang['de'][15] = 'Standard (Kompromiss zwischen Lesbarkeit und Größe)'; 126 | $lang['de'][16] = 'Niedrig (höhere Lesbarkeit)'; 127 | $lang['de'][17] = 'Benutzerdefiniert (unten eingeben)'; 128 | $lang['de'][18] = 'Benutzerdefinierte Vorlage'; 129 | $lang['de'][19] = 'Optionen'; 130 | $lang['de'][20] = 'Selektoren sortieren (Vorsicht)'; 131 | $lang['de'][21] = 'Eigenschaften sortieren'; 132 | $lang['de'][22] = 'Selektoren umgruppieren'; 133 | $lang['de'][23] = 'Shorthands optimieren'; 134 | $lang['de'][24] = 'Farben komprimieren'; 135 | $lang['de'][25] = 'Selektoren in Kleinbuchstaben'; 136 | $lang['de'][26] = 'Groß-/Kleinschreibung für Eigenschaften'; 137 | $lang['de'][27] = 'Kleinbuchstaben'; 138 | $lang['de'][28] = 'Keine oder ungültige CSS Eingabe oder falsche URL!'; 139 | $lang['de'][29] = 'Großbuchstaben'; 140 | $lang['de'][30] = 'kleingeschriebene Elementnamen benötigt für XHTML'; 141 | $lang['de'][31] = 'Unnötige Backslashes entfernen'; 142 | $lang['de'][32] = '!important-Hack konvertieren'; 143 | $lang['de'][33] = 'Als Datei ausgeben'; 144 | $lang['de'][34] = 'Größere Komprimierung augrund von kleineren Neuezeile-Zeichen'; 145 | $lang['de'][35] = 'CSS verarbeiten'; 146 | $lang['de'][36] = 'Komprimierungsrate'; 147 | $lang['de'][37] = 'Eingabe'; 148 | $lang['de'][38] = 'Ausgabe'; 149 | $lang['de'][39] = 'Sprache'; 150 | $lang['de'][41] = 'Achtung: Dies könnte das Verhalten ihres CSS-Codes verändern!'; 151 | $lang['de'][42] = 'Letztes ; entfernen'; 152 | $lang['de'][43] = 'Ungültige Eigenschaften entfernen'; 153 | $lang['de'][44] = 'Nur sichere Optimierungen'; 154 | $lang['de'][45] = 'font-weight komprimieren'; 155 | $lang['de'][46] = 'Kommentare beibehalten'; 156 | $lang['de'][47] = 'Nichts ändern'; 157 | $lang['de'][48] = 'Selektoren nur trennen (am Komma)'; 158 | $lang['de'][49] = 'Selektoren mit gleichen Eigenschaften zusammenfassen (schnell)'; 159 | $lang['de'][50] = 'Selektoren intelligent zusammenfassen (langsam!)'; 160 | $lang['de'][51] = 'CSS erhalten'; 161 | $lang['de'][52] = 'Kommentare, Hacks, etc. speichern. Viele Optimierungen sind dann aber nicht mehr möglich.'; 162 | $lang['de'][53] = 'Keine'; 163 | $lang['de'][54] = 'Nicht optimieren'; 164 | $lang['de'][55] = 'Sichere Optimierungen'; 165 | $lang['de'][56] = 'Alle Optimierungen'; 166 | $lang['de'][57] = 'Zeitstempel hinzufügen'; 167 | $lang['de'][58] = 'Copy to clipboard'; 168 | $lang['de'][59] = 'Back to top'; 169 | $lang['de'][60] = 'Your browser doesn\'t support copy to clipboard.'; 170 | $lang['de'][61] = 'For bugs and suggestions feel free to'; 171 | $lang['de'][62] = 'contact me'; 172 | $lang['de'][63] = 'Output CSS code as complete HTML document'; 173 | $lang['de'][64] = 'Code'; 174 | $lang['de'][65] = 'CSS to style CSS output'; 175 | $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.'; 176 | 177 | 178 | $lang['fr'][0] = 'CSS Formateur et Optimiseur (basé sur CSSTidy '; 179 | $lang['fr'][1] = 'CSS Formateur et Optimiseur'; 180 | $lang['fr'][2] = '(basé sur '; 181 | $lang['fr'][3] = '(Version texte)'; 182 | $lang['fr'][4] = 'Note Importante :'; 183 | $lang['fr'][6] = 'Votre code doit être valide. Ce n’est pas un validateur qui signale les erreurs dans votre code CSS. Pour être sûr que votre code est correct, utilisez le validateur : W3C Validator.'; 184 | $lang['fr'][7] = 'tous les commentaires sont enlevés'; 185 | $lang['fr'][8] = 'Champ CSS :'; 186 | $lang['fr'][9] = 'Code CSS :'; 187 | $lang['fr'][10] = 'CSS en provenance d’une URL :
'; 188 | $lang['fr'][11] = 'Mise en page du code :'; 189 | $lang['fr'][12] = 'Compression (mise en page du code) :'; 190 | $lang['fr'][13] = 'La plus élevée (aucune lisibilité, taille minimale)'; 191 | $lang['fr'][14] = 'Élevée (lisibilité modérée, petite taille)'; 192 | $lang['fr'][15] = 'Normale (équilibre entre lisibilité et taille)'; 193 | $lang['fr'][16] = 'Faible (lisibilité élevée)'; 194 | $lang['fr'][17] = 'Sur mesure (entrer ci-dessous)'; 195 | $lang['fr'][18] = 'Gabarit sur mesure'; 196 | $lang['fr'][19] = 'Options'; 197 | $lang['fr'][20] = 'Trier les sélecteurs (attention)'; 198 | $lang['fr'][21] = 'Trier les propriétés'; 199 | $lang['fr'][22] = 'Regrouper les sélecteurs'; 200 | $lang['fr'][23] = 'Propriétés raccourcies'; 201 | $lang['fr'][24] = 'Compresser les couleurs'; 202 | $lang['fr'][25] = 'Sélecteurs en minuscules'; 203 | $lang['fr'][26] = 'Case pour les propriétés :'; 204 | $lang['fr'][27] = 'Minuscule'; 205 | $lang['fr'][28] = 'CSS non valide ou URL incorrecte !'; 206 | $lang['fr'][29] = 'Majuscule'; 207 | $lang['fr'][30] = 'les noms des éléments en minuscules (indispensables pour XHTML)'; 208 | $lang['fr'][31] = 'enlever les antislashs inutiles'; 209 | $lang['fr'][32] = 'convertir !important-hack'; 210 | $lang['fr'][33] = 'Sauver en tant que fichier'; 211 | $lang['fr'][34] = 'Meilleure compression grâce aux caractères de saut de ligne plus petits (copier & coller ne marche pas)'; 212 | $lang['fr'][35] = 'Compresser la CSS'; 213 | $lang['fr'][36] = 'Facteur de Compression'; 214 | $lang['fr'][37] = 'Entrée'; 215 | $lang['fr'][38] = 'Sortie'; 216 | $lang['fr'][39] = 'Langue'; 217 | $lang['fr'][41] = 'Attention : ceci peut changer le comportement de votre code CSS !'; 218 | $lang['fr'][42] = 'Enlever le dernier ;'; 219 | $lang['fr'][43] = 'Supprimer les propriétés non valide'; 220 | $lang['fr'][44] = 'Seulement les optimisations sûres'; 221 | $lang['fr'][45] = 'Compresser font-weight'; 222 | $lang['fr'][46] = 'Sauvegarder les commentaires '; 223 | $lang['fr'][47] = 'Ne rien changer'; 224 | $lang['fr'][48] = 'Sépare les sélecteurs (sépare au niveau de ,)'; 225 | $lang['fr'][49] = 'Fusionne les sélecteurs avec les mêmes propriétés (rapide)'; 226 | $lang['fr'][50] = 'Fusionne les sélecteurs intelligemment (lent)'; 227 | $lang['fr'][51] = 'Préserver la CSS'; 228 | $lang['fr'][52] = 'Sauvegarder les commentaires, hacks, etc. La plupart des optimisations ne peuvent *pas* être appliquées si cela est activé.'; 229 | $lang['fr'][53] = 'Aucun'; 230 | $lang['fr'][54] = 'Ne pas optimiser'; 231 | $lang['fr'][55] = 'Optimisations sûres'; 232 | $lang['fr'][56] = 'Toutes les optimisations'; 233 | $lang['fr'][57] = 'Ajouter un timestamp'; 234 | $lang['fr'][58] = 'Copier dans le presse-papiers'; 235 | $lang['fr'][59] = 'Retour en haut'; 236 | $lang['fr'][60] = 'Votre navigateur ne supporte pas la copie vers le presse-papiers.'; 237 | $lang['fr'][61] = 'Pour signaler des bugs ou pour des suggestions,'; 238 | $lang['fr'][62] = 'contactez-moi'; 239 | $lang['fr'][63] = 'Sauver le code CSS comme document complet HTML'; 240 | $lang['fr'][64] = 'Code'; 241 | $lang['fr'][65] = 'CSS pour colorier la sortie CSS'; 242 | $lang['fr'][66] = 'Vous devez aller dans about:config dans votre barre d’adresse, sélectionner \'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é.'; 243 | 244 | 245 | $lang['zh'][0] = 'CSS整形與最佳化工具(使用 CSSTidy '; 246 | $lang['zh'][1] = 'CSS整形與最佳化工具'; 247 | $lang['zh'][2] = '(使用'; 248 | $lang['zh'][3] = '(純文字)'; 249 | $lang['zh'][4] = '重要事項:'; 250 | $lang['zh'][6] = '你的原始碼必須是良構的(well-formed). 這個工具沒有內建驗證器(validator). 驗證器能夠指出你CSS原始碼裡的錯誤. 請使用 W3C 驗證器, 確保你的原始碼合乎規範.'; 251 | $lang['zh'][7] = '所有註解都移除了'; 252 | $lang['zh'][8] = 'CSS 輸入:'; 253 | $lang['zh'][9] = 'CSS 原始碼:'; 254 | $lang['zh'][10] = 'CSS 檔案網址(URL):'; 255 | $lang['zh'][11] = '原始碼規劃:'; 256 | $lang['zh'][12] = '壓縮程度(原始碼規劃):'; 257 | $lang['zh'][13] = '最高 (沒有辦法讀, 檔案最小)'; 258 | $lang['zh'][14] = '高 (適度的可讀性, 檔案小)'; 259 | $lang['zh'][15] = '標準 (兼顧可讀性與檔案大小)'; 260 | $lang['zh'][16] = '低 (注重可讀性)'; 261 | $lang['zh'][17] = '自訂 (在下方設定)'; 262 | $lang['zh'][18] = '自訂樣板'; 263 | $lang['zh'][19] = '選項'; 264 | $lang['zh'][20] = '整理選擇符(請謹慎使用)'; 265 | $lang['zh'][21] = '整理屬性'; 266 | $lang['zh'][22] = '重組選擇符'; 267 | $lang['zh'][23] = '速記法(shorthand)最佳化'; 268 | $lang['zh'][24] = '壓縮色彩語法'; 269 | $lang['zh'][25] = '改用小寫選擇符'; 270 | $lang['zh'][26] = '屬性的字形:'; 271 | $lang['zh'][27] = '小寫'; 272 | $lang['zh'][28] = '沒有輸入CSS, 語法不符合規定, 或是網址錯誤!'; 273 | $lang['zh'][29] = '大寫'; 274 | $lang['zh'][30] = 'XHTML必須使用小寫的元素名稱'; 275 | $lang['zh'][31] = '移除不必要的反斜線'; 276 | $lang['zh'][32] = '轉換 !important-hack'; 277 | $lang['zh'][33] = '輸出成檔案形式'; 278 | $lang['zh'][34] = '由於比較少換行字元, 會有更大的壓縮比率(複製&貼上沒有用)'; 279 | $lang['zh'][35] = '執行'; 280 | $lang['zh'][36] = '壓縮比率'; 281 | $lang['zh'][37] = '輸入'; 282 | $lang['zh'][38] = '輸出'; 283 | $lang['zh'][39] = '語言'; 284 | $lang['zh'][41] = '注意: 這或許會變更你CSS原始碼的行為!'; 285 | $lang['zh'][42] = '除去最後一個分號'; 286 | $lang['zh'][43] = '拋棄不符合規定的屬性'; 287 | $lang['zh'][44] = '只安全地最佳化'; 288 | $lang['zh'][45] = '壓縮 font-weight'; 289 | $lang['zh'][46] = '保留註解'; 290 | $lang['zh'][47] = '什麼都不要改'; 291 | $lang['zh'][48] = '只分開原本用逗號分隔的選擇符'; 292 | $lang['zh'][49] = '合併有相同屬性的選擇符(快速)'; 293 | $lang['zh'][50] = '聰明地合併選擇符(慢速)'; 294 | $lang['zh'][51] = '保護CSS'; 295 | $lang['zh'][52] = '保留註解與 hack 等等. 如果啟用這個選項, 大多數的最佳化程序都不會執行.'; 296 | $lang['zh'][53] = '不改變'; 297 | $lang['zh'][54] = '不做最佳化'; 298 | $lang['zh'][55] = '安全地最佳化'; 299 | $lang['zh'][56] = '全部最佳化'; 300 | $lang['zh'][57] = '加上時間戳記'; 301 | $lang['zh'][58] = '复制到剪贴板'; 302 | $lang['zh'][59] = '回到页面上方'; 303 | $lang['zh'][60] = '你的浏览器不支持复制到剪贴板。'; 304 | $lang['zh'][61] = '如果程序有错误或你有建议,欢迎'; 305 | $lang['zh'][62] = '和我联系'; 306 | $lang['zh'][63] = 'Output CSS code as complete HTML document'; 307 | $lang['zh'][64] = '代码'; 308 | $lang['zh'][65] = 'CSS to style CSS output'; 309 | $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.'; 310 | --------------------------------------------------------------------------------