PHPackages                             adam-lynch/simple-feature-detector - 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. adam-lynch/simple-feature-detector

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

adam-lynch/simple-feature-detector
==================================

A very lightweight dependency-free feature-detector

1.0.0(12y ago)128[1 issues](https://github.com/adam-lynch/simple-feature-detector/issues)[1 PRs](https://github.com/adam-lynch/simple-feature-detector/pulls)JavaScript

Since Jun 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/adam-lynch/simple-feature-detector)[ Packagist](https://packagist.org/packages/adam-lynch/simple-feature-detector)[ Docs](https://github.com/adam-lynch/simple-feature-detector)[ RSS](/packages/adam-lynch-simple-feature-detector/feed)WikiDiscussions master Synced 3w ago

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

Simple Feature Detector
=======================

[](#simple-feature-detector)

[![Bower version](https://camo.githubusercontent.com/184dc7132b40fbd79f7f450435c3dec85619f69605fa652046b8b083e6014c1d/687474703a2f2f696d672e736869656c64732e696f2f626f7765722f762f73696d706c652d666561747572652d6465746563746f722e7376673f7374796c653d666c6174)](https://github.com/adam-lynch/simple-feature-detector) [![NPM version](https://camo.githubusercontent.com/44905acd5361248032aab97c5bf1eb0fe9f12ab9fed6550d8eddc964e4c26e78/687474703a2f2f696d672e736869656c64732e696f2f6e706d2f762f73696d706c652d666561747572652d6465746563746f722e7376673f7374796c653d666c6174)](https://npmjs.org/package/simple-feature-detector) [![Build Status](https://camo.githubusercontent.com/76e3657110bf3569d1da76e248889c6c5a6302ba89c54479ee26950ee7d00530/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f6164616d2d6c796e63682f73696d706c652d666561747572652d6465746563746f722e7376673f7374796c653d666c6174)](http://travis-ci.org/adam-lynch/simple-feature-detector) [![Windows Build Status](https://camo.githubusercontent.com/5c607f1273bcd56961646c92c934a9aaf435545a7951c3c4b840af1a892b2e9e/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f377378623777636679703033766b34632f6272616e63682f6d61737465723f7376673d74727565)](https://ci.appveyor.com/project/adam-lynch/simple-feature-detector/branch/master)

---

A very lightweight (847 bytes gzipped) dependency-free module to easily detect CSS features in the browser (and declare their support adding CSS classes to the HTML element).

### Usage

[](#usage)

- [Download](https://github.com/adam-lynch/simple-feature-detector/raw/master/simple-feature-detector.min.js) / get from: [npm](https://www.npmjs.org/package/simple-feature-detector), [bower](http://bower.io/search/?q=simple-feature-detector) or [packagist](https://packagist.org/packages/adam-lynch/simple-feature-detector).
- Usage: [UMD](https://github.com/umdjs/umd) is supported so you can use this with AMDs / [RequireJS](http://requirejs.org/), commonjs / [browserify](http://browserify.org/), or simply by sticking the `` in your HTML and use the global `SimpleFeatureDetector` function. See the [examples](https://github.com/adam-lynch/simple-feature-detector/tree/master/examples) for an example of each.
- Declare support for a feature

```
SimpleFeatureDetector.supports({  property: 'column-width', vendors: 'wg' });
```

Each object contains the CSS property desired and the vendors which it should check for\*, *if* it's not supported natively. Possible values:

- `g` - Gecko (Firefox)
- `k` - KHTML (Konqueror)
- `p` - Presto (Opera)
- `t` - Trident (IE)
- `w` - WebKit
- `all` - All of the above
- `""` - return false if not supported natively

The result: `...`

- Check support for multiple features

```
SimpleFeatureDetector.supports([
            { property: 'column-width', vendors: 'wg' },
            { property: 'border-radius', vendors: 'all' },
            { property: 'transform-style', vendors: '' } //will check for native support only
        ]);
```

- To simply determine if a feature is supported without adding classes to the DOM, use the second parameter `declareSupport` (which defaults to `true`)

```
if(SimpleFeatureDetector.supports( { property: 'column-width', vendors: 'wg' }, false )){
            alert('Yes!');
        }
```

- Caching: There is none. Use this wisely :)

---

### Browser support

[](#browser-support)

You'll be fine. Tested as far back as Internet Explorer 8.

---

\* You wouldn't want to check for a vendor+property combination when it never existed (like `o-border-radius`), among other possible reasons.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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

Every ~9 days

Total

2

Last Release

4400d ago

Major Versions

0.0.6 → 1.0.02014-06-13

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1427241?v=4)[Adam Lynch](/maintainers/adam-lynch)[@adam-lynch](https://github.com/adam-lynch)

---

Top Contributors

[![adam-lynch](https://avatars.githubusercontent.com/u/1427241?v=4)](https://github.com/adam-lynch "adam-lynch (74 commits)")

---

Tags

javascriptcssfeature detection

### Embed Badge

![Health badge](/badges/adam-lynch-simple-feature-detector/health.svg)

```
[![Health](https://phpackages.com/badges/adam-lynch-simple-feature-detector/health.svg)](https://phpackages.com/packages/adam-lynch-simple-feature-detector)
```

###  Alternatives

[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k32.3M424](/packages/matthiasmullie-minify)[stolz/assets

An ultra-simple-to-use assets management library

289527.4k8](/packages/stolz-assets)[janmarek/webloader

Tool for loading or deploying CSS and JS files into web pages

107516.7k14](/packages/janmarek-webloader)[axy/sourcemap

Work with JavaScript/CSS Source Map

25756.3k7](/packages/axy-sourcemap)[dotsunited/bundlefu

BundleFu is a PHP 5.3+ library which bundles multiple css/javascript files into a big package and sends it out at once

7028.8k3](/packages/dotsunited-bundlefu)[doublesecretagency/craft-cpbodyclasses

Adds special classes to the Control Panel's &lt;body&gt; tag.

2437.8k](/packages/doublesecretagency-craft-cpbodyclasses)

PHPackages © 2026

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