PHPackages                             csssplitter/cssplitter - 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. csssplitter/cssplitter

Abandoned → [dlundgren/css-splitter](/?search=dlundgren%2Fcss-splitter)Library[Utility &amp; Helpers](/categories/utility)

csssplitter/cssplitter
======================

PHP Css Splitter for IE 4096 selector limit

1.0.0(10y ago)99274[1 PRs](https://github.com/dlundgren/php-css-splitter/pulls)MITPHPPHP &gt;=5.3.0

Since Oct 8Pushed 4y ago2 watchersCompare

[ Source](https://github.com/dlundgren/php-css-splitter)[ Packagist](https://packagist.org/packages/csssplitter/cssplitter)[ RSS](/packages/csssplitter-cssplitter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

PHP Css Splitter
================

[](#php-css-splitter)

[![Build Status](https://camo.githubusercontent.com/ed359b50fcccf3a480e5730eb090e99ece38868c238053346a193ab4be38863f/68747470733a2f2f7472617669732d63692e6f72672f646c756e646772656e2f7068702d6373732d73706c69747465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dlundgren/php-css-splitter)

Splits stylesheets that go beyond the IE limit of 4096 selectors. See this [MSDN blog post](http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/internet-explorer-stylesheet-rule-selector-import-sheet-limit-maximum.aspx) for more information about this.

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

[](#installation)

Use composer

Usage
-----

[](#usage)

The default max selectors is 4095.

```
$splitter = new \CssSplitter\Splitter();
// Load your css file
$css = file_get_contents('styles.css');

// Skip the first part as the Internet Explorer interprets your css until it reaches the limit
$selector_count = $splitter->countSelectors($css) - 4095;
// Calculate how many additional parts we need to create
$additional_part_count =  ceil($selector_count / 4095);

if($additional_part_count > 0) {
	// Loop and create the additional parts
	// Add an offset of two as we are creating the css from the second part on
	for($part = 2; $part < $additional_part_count + 2; $part++) {
		// Create or update the css files
		file_put_contents('styles_'. $part .'.css', $splitter->split($css, $part));
	}
}
```

Credits &amp; License
---------------------

[](#credits--license)

Original inspiration came from the Ruby gem [CssSplitter](https://github.com/zweilove/css_splitter).

Uses the MIT license.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% 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

3875d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5eb9bc1606754fee81247bf5d4a6a4d7fb7cce1b3769de69a345c5c8e120211e?d=identicon)[dlundgren](/maintainers/dlundgren)

---

Top Contributors

[![dlundgren](https://avatars.githubusercontent.com/u/1322393?v=4)](https://github.com/dlundgren "dlundgren (12 commits)")[![cgsmith](https://avatars.githubusercontent.com/u/570018?v=4)](https://github.com/cgsmith "cgsmith (1 commits)")

---

Tags

css splitter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/csssplitter-cssplitter/health.svg)

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

###  Alternatives

[drupal/console-dotenv

Drupal Console Dotenv

871.2M](/packages/drupal-console-dotenv)

PHPackages © 2026

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