PHPackages                             danbettles/yacm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. danbettles/yacm

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

danbettles/yacm
===============

v1.0.0(10y ago)0296MITPHPPHP &gt;=5.4.0

Since Jul 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/danbettles/yacm)[ Packagist](https://packagist.org/packages/danbettles/yacm)[ RSS](/packages/danbettles-yacm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Yet Another CSS Minifier
========================

[](#yet-another-css-minifier)

YACM is a lightweight, but effective, CSS minifier. It is slightly different from other minifiers in that it preserves the approximate vertical structure of the original CSS - so unless the formatting of the input is very unusual, the output should be just about readable.

The code is unit-tested and can be installed using Composer.

This code is based on [a Gist of mine](https://gist.github.com/danbettles/5781842).

Basic Usage
-----------

[](#basic-usage)

```
use Danbettles\Yacm\Minifier as CssMinifier;

//@todo Load the library.

$minifiedCss = CssMinifier::minifyNow('body { font-size: 1em; }');

//Or

$cssMinifier = new CssMinifier();
$minifiedCss = $cssMinifier->minify('body { font-size: 1em; }');
```

Use with BundleFu
-----------------

[](#use-with-bundlefu)

You can minify the CSS bundled by [BundleFu](https://github.com/dotsunited/BundleFu) by calling YACM in a `CallbackFilter` filter.

```
//@todo Create bundle as per Dots United's instructions.

$minifyCssFilter = new \DotsUnited\BundleFu\Filter\CallbackFilter(function($content) {
    return \Danbettles\Yacm\Minifier::minifyNow($content);
});

$bundle->setCssFilter($minifyCssFilter);

//@todo Continue using bundle as per Dots United's instructions.
```

If you need to add multiple CSS filters to your bundle then [follow Dots United's instructions on creating and using a filter chain](https://github.com/dotsunited/BundleFu#filters).

Installation
------------

[](#installation)

Install using [Composer](https://getcomposer.org/).

```
composer require danbettles/yacm:dev-master
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3956d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb4422c02b29b1ae4a4746abb1ebf16c0216d5fc62cf0604e7c6aa4de974b39b?d=identicon)[danbettles](/maintainers/danbettles)

---

Top Contributors

[![danbettles](https://avatars.githubusercontent.com/u/736672?v=4)](https://github.com/danbettles "danbettles (3 commits)")

### Embed Badge

![Health badge](/badges/danbettles-yacm/health.svg)

```
[![Health](https://phpackages.com/badges/danbettles-yacm/health.svg)](https://phpackages.com/packages/danbettles-yacm)
```

###  Alternatives

[koalafacade/filament-navigation-holder

A holder package for filament navigation scroll position

1617.8k](/packages/koalafacade-filament-navigation-holder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
