定制 cerdic/css-tidy 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cerdic/css-tidy

Composer 安装命令:

composer require cerdic/css-tidy

包简介

CSSTidy is a CSS minifier

README 文档

README

CSSTidy is a CSS minifier

  • css_optimiser.php is the web-interface
  • class.csstidy.php is the parser
  • bin/pcsstidy is the standalone command line executable

This class represents a CSS parser which reads CSS code and saves it in an array. In opposite to most other CSS parsers, it does not use regular expressions and thus has full CSS3 support and a higher reliability. The downside of not using regular expressions is a lower speed though. Additional to that it applies some optimisations and fixes to the CSS code.

Usage

include('class.csstidy.php');
$csstidy = new csstidy();

// Set some options :
$csstidy->set_cfg('optimise_shorthands', 2);
$csstidy->set_cfg('template', 'high');

// Parse the CSS
$csstidy->parse($css_code);

// Get back the optimized CSS Code
$css_code_opt = $csstidy->print->plain();

Changelog

  • v2.2.0 :
    • test suite switch to phpunit
  • v2.1.0 :
    • fix issues with css4 colors
  • v2.0.0 :
    • PHP 7.1 is the minimal version. Compatible PHP 8.0 and 8.1
  • v1.7.3 :
    • fix bug and notice on reverse_left_and_right option
  • v1.7.1 :
    • fix deprecated with PHP 7.4
  • v1.7.0 :
    • provide bin/pcsstidy for command line usage
    • support nested @media and @supports rules
  • v1.6.5 :
    • fix warnings with PHP 7.3
  • v1.6.4 :
    • preserve important comments (starting with !) in the minification /*! Credits/Licence */
  • v1.6.3 :
    • border-radius shorthands optimisation, reverse_left_and_right option
  • v1.5.7 :
    • PHP 7 compatibility, composer update, Travis CI integration
  • v1.5.6 :
    • fixes minor bugs, mainly on CSS3 properties/units
  • v1.5.2 :
  • v1.4 :
    • Is the new version coming from master branch (corresponds to the initial trunk of svn repository) after beeing stabilized
  • v1.3 branch corresponds to the last stable relase published by the author.

Only PHP version is here maintained

Licence

Copyright 2005-2007 Florian Schmitz Copyright 2010-2019 Cedric Morin

CSSTidy is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

CSSTidy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

History

Original Tracker : http://sourceforge.net/tracker/?group_id=148404&atid=771415

cerdic/css-tidy 适用场景与选型建议

cerdic/css-tidy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.11M 次下载、GitHub Stars 达 210, 最近一次更新时间为 2013 年 12 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「css」 「minifier」 「tidy」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 cerdic/css-tidy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 cerdic/css-tidy 我们能提供哪些服务?
定制开发 / 二次开发

基于 cerdic/css-tidy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2.11M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 211
  • 点击次数: 19
  • 依赖项目数: 8
  • 推荐数: 4

GitHub 信息

  • Stars: 210
  • Watchers: 20
  • Forks: 62
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-2.1-or-later
  • 更新时间: 2013-12-07