PHPackages                             aretecode/planck-id - 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. aretecode/planck-id

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

aretecode/planck-id
===================

Minifies (almost) all HTML ids + classes, &amp; CSS + JS selectors

72[1 issues](https://github.com/aretecode/planck-id/issues)PHP

Since May 6Pushed 10y ago1 watchersCompare

[ Source](https://github.com/aretecode/planck-id)[ Packagist](https://packagist.org/packages/aretecode/planck-id)[ RSS](/packages/aretecode-planck-id/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#PlanckId (planck-id) [![Build Status](https://camo.githubusercontent.com/c4ed8df93529ef325efd86b002de1c77ea5864237f7ebd8f46369b2e1cc706f8/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6172657465636f64652f706c616e636b2d69642e737667)](https://travis-ci.org/aretecode/planck-id)[![HHVM Status](https://camo.githubusercontent.com/b45c5e47f0d01db71865b79c2e4c578cbb8524484f9842bec30d869af45dfa2e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4848564d2d7465737465642d627269676874677265656e2e737667)](http://hhvm.h4cc.de/package/aretecode/planck-id)[![License](https://camo.githubusercontent.com/2b943f42d9ef21ef3cbad66085d4d14843e74c1ecc801e4ccd0648400b7dccd0/68747470733a2f2f706f7365722e707567782e6f72672f6172657465636f64652f706c616e636b2d69642f6c6963656e7365)](http://packagist.org/packages/aretecode/planck-id)[![Latest Unstable Version](https://camo.githubusercontent.com/bb3ed405ef70a14412be396be4aa3a6ad69c8f4b59994bbd8ad74ec988aa9572/68747470733a2f2f706f7365722e707567782e6f72672f6172657465636f64652f706c616e636b2d69642f762f756e737461626c65)](https://poser.pugx.org/aretecode/planck-id/v/unstable)[![Codacy Badge](https://camo.githubusercontent.com/e354cb91d9693d47ebc117e526abea291540c6f5d02df82db43513b37aba554f/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f3665613639663631316362383463363338363262323735306135653438353633)](http://www.codacy.com/app/aretecode/planck-id)[![shrinking](https://camo.githubusercontent.com/20ec31308b0b58c4b6eb43c629445ff81113d3d94424dcff10c6aea9be86cdb2/687474703a2f2f6a6f6e6c696566666d642e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031322f30312f35313270782d5363616c655f6f6e655f746f5f74686f7573616e645f766f6c756d652e7376675f332e706e67)](https://camo.githubusercontent.com/20ec31308b0b58c4b6eb43c629445ff81113d3d94424dcff10c6aea9be86cdb2/687474703a2f2f6a6f6e6c696566666d642e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031322f30312f35313270782d5363616c655f6f6e655f746f5f74686f7573616e645f766f6c756d652e7376675f332e706e67)

What is it?
-----------

[](#what-is-it)

Minifies (almost) all HTML ids + classes, &amp; CSS + JS selectors.

Example
-------

[](#example)

Turns this:

```

    Use Github

.pull-right, .btn, .btn-primary, .btn-github, .icon-github {} #special_github{}
.btn{}
var githubButtons = document.getElementsByClassName('btn-github'); var specialGithub = document.getElementById('special_github');
githubIconButtons = $('.icon-github');
```

Into this:

```

    Use Github

.c, .e, .a, .d, .b {} #f{}
.e{}
var githubButtons = document.getElementsByClassName('d'); var specialGithub = document.getElementById('f');
githubIconButtons = $('.b');
```

Graphs
------

[](#graphs)

Put the .json files from [planck-id/graphs](http://github.com/aretecode/planck-id/graphs/) into [NoFlo](http://noflojs.org)

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

[](#installation)

It can be installed from [Packagist](https://packagist.org/planck-id) using [Composer](https://getcomposer.org/). Make sure your `composer.json` contains:

```
{
    "require": {
        "aretecode/planck-id"
    }
}
```

then, run:

```
$ wget http://getcomposer.org/composer.phar
$ php composer.phar install

```

Use
---

[](#use)

### Basic Usage

[](#basic-usage)

[See examples](https://github.com/aretecode/planck-id/blob/master/examples)
---------------------------------------------------------------------------

[](#see-examples)

Command Line
------------

[](#command-line)

#### Converting a file named markup.html:

[](#converting-a-file-named-markuphtml)

`planck markup.html`

#### Converting a file named markup.html:

[](#converting-a-file-named-markuphtml-1)

`planck markup.html --debug`

#### Converting a file and saving its output:

[](#converting-a-file-and-saving-its-output)

`planck markup.html > output.html`

#### Converting a file using an existing map replacing a style file:

[](#converting-a-file-using-an-existing-map-replacing-a-style-file)

`planck style.css map.json style Replace`

#### Converting a file using an existing map, extracting more to add to the map, then replacing a style file:

[](#converting-a-file-using-an-existing-map-extracting-more-to-add-to-the-map-then-replacing-a-style-file)

`planck style.css map.json style ExtractAndReplace`

#### Extracting the the contents of a file and adding it to a map:

[](#extracting-the-the-contents-of-a-file-and-adding-it-to-a-map)

`planck markup.html map.json markup Extract`

#### Converting from STDIN

[](#converting-from-stdin)

`echo -e '.post-simple{}' | planck`

#### Converting from STDIN and saving the output:

[](#converting-from-stdin-and-saving-the-output)

`echo -e '.post-simple{}' | planck > output.html`

Terminology
-----------

[](#terminology)

- *Planck*: ([Planck length](https://en.wikipedia.org/wiki/Planck_length), in principle, the shortest measurable length.) an instance of the shortest available valid class/id/selector.
- *Original*: the *class/id/selector* before it was turned into a Planck. (I'm open to changing this, feel free to suggest a new term.)

How does it do this?
--------------------

[](#how-does-it-do-this)

Using [Flow Based Progamming](http://www.jpaulmorrison.com/fbp/) it creates a `map` according to the requirements, then passes the content into the series of components to achieve the desired outcome.

Running tests
-------------

[](#running-tests)

1. Run in the browser by navigating to `planck-id/tests/Run.php`
2. Run via the command line by changing your directory to `planck-id/bin` and then running `behat`
3. Run via the command line by going to `planck-id` and running `phpunit`

(*these tests use a snippet from thegrids website*)

[Todos](https://github.com/aretecode/planck-id/blob/master/TODO.md)
-------------------------------------------------------------------

[](#todos)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![aretecode](https://avatars.githubusercontent.com/u/4022631?v=4)](https://github.com/aretecode "aretecode (61 commits)")

### Embed Badge

![Health badge](/badges/aretecode-planck-id/health.svg)

```
[![Health](https://phpackages.com/badges/aretecode-planck-id/health.svg)](https://phpackages.com/packages/aretecode-planck-id)
```

PHPackages © 2026

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