miripiruni/csscomb

整理CSS属性的绝佳工具。

安装: 515

依赖: 0

建议者: 0

安全: 0

星星: 616

关注者: 55

分支: 49

2.14 2013-07-08 04:58 UTC

This package is not auto-updated.

Last update: 2024-09-22 03:07:17 UTC


README

CSScomb的这个版本已经不再支持了,朋友们。
我们有一个新的超级酷的Node.js版本代替它!

整理CSS属性的工具

  • 将CSS属性整理成逻辑一致的顺序
  • 允许自定义CSS属性的排序(设置为您习惯的任何顺序)
  • 解析样式标签和样式属性中的CSS - 也可以整理其他语言的CSS
  • 不会改变现有样式表的格式 - 目标单行或多行CSS
  • 将CSS属性分组(如果您想的话,可以有空字符串组)
  • 完全支持CSS2/CSS2.1/CSS3

CSScomb算法模拟了网页开发者对CSS样式排序的判断。您可以花费大量时间重新排序代码--移动行,绕过代码中的注释,移动多行属性值集,以及各种黑客技巧来使代码更易于阅读。CSScomb为您处理这些任务。它像人类编辑文本一样“思考”,而不是像盲目的机器人解析CSS。

CSScomb.com

要求

CSScomb是用纯PHP编写的,没有任何外部库或依赖。有关详细信息,请参阅wiki

下载插件

  • Sublime Text 2插件在Package Control中可用,名称为'CSScomb'
  • TextMate插件
  • Coda插件
  • Coda 2插件
  • Espresso 2插件(安装方法
  • IntelliJIDEA插件
  • WebStorm插件
  • PyCharm插件
  • Notepad ++插件
  • Chocolat Mixin
  • Vim插件

CLI使用

csscomb.com上可用

% php csscomb.php

CSSComb
Command line tool for resort CSS code.

SYNOPSIS
    $ php csscomb.php -s <file with JSON array> -i <path to input css file> -o <path to result css file>

DESCRIPTION
    options:
    -s, --sort-order    specify file with custom sort order. File must contain JSON data. For detail information run 'csscomb.php --help-sort-order'
    -i, --input         must be directory name or file that needs to be sorted
    -o, --output        sort result file. Use output when input is not a directory name, otherwise output param ignored. If output filename does not exist, the file is created. Otherwise, the existing file is overwritten.

    --help, -help, -h, -? or no options will print this man.

EXAMPLE
    csscomb.php -s my-custom-sort-order.json -i css/style.css -o css/style-resorted.css

EXAMPLE 2
    csscomb.php -i some_directory_name

Twitter

@csscomb