drupaljedi/css-tree-shaking 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

drupaljedi/css-tree-shaking

最新稳定版本:1.1.0

Composer 安装命令:

composer require drupaljedi/css-tree-shaking

包简介

Helps you to eliminate the portions of CSS you aren't using. Usually should be used to generate AMP pages, where is the fixed limit for maximum styles size.

README 文档

README

Build Status codecov Maintainability Total Downloads

Helps you to eliminate the portions of CSS you aren't using. Usually should be used to generate AMP pages, where is the fixed limit for maximum styles size.

Installation

composer require drupaljedi/css-tree-shaking

Usage

Pretty simple to use, just create the object and shake it :)

<?php

include 'vendor/autoload.php';

use DrupalJedi\CssTreeShaking;

$cssShaker = new CssTreeShaking($html);
$optimizedHtml = $cssShaker->shakeIt();

Where $html is raw HTML with inliny styles.

By default, styles will be shaken only if the limit (50kb) is exceeded. If you want to shake the styles in any case, just call the shakeIt() with a TRUE argument:

$optimizedHtml = $cssShaker->shakeIt(TRUE);

Features

  • PSR-4 autoloading compliant structure
  • Easy to use to any framework or even a plain php file

统计信息

  • 总下载量: 22.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2018-11-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固