<commit_before># [actual](../../)

#### Determine actual `@media` breakpoints for [CSS <b>range</b> features](http://dev.w3.org/csswg/mediaqueries4/#media-descriptor-table)

- <b>actual</b> calculates responsive breakpoints that <em>accurately</em> match CSS media queries
- <b>actual</b> is based on [this gist](https://gist.github.com/ryanve/7924792)

## API ([0.2](../../releases))

### `actual(feature, unit?, init?, step?)`

- <var>feature</var>: [CSS range feature name](http://dev.w3.org/csswg/mediaqueries4/#media-descriptor-table)
- <var>unit</var>: applicable CSS unit (default: unitless)
- <var>init</var>: initial guess (default: `1`)
- <var>step</var>: step size (default: varies by unit)

```js
actual('width', 'em') // => 87.40625
actual('device-width', 'px') // => 1440
actual('resolution', 'dpi') // => 96
actual('color') // => 10
```

### `actual.mq(query)`
- Test if a media query is active
- <b>@return</b> boolean

```js
actual.mq('tv')
actual.mq('(width:30em)')
```

### `actual.feature(feature)`
- Create a partial function that gets <var>feature</var> in a given unit
- <b>@return</b> function

```js
['px', 'em', 'pt', 'in', 'cm', 'mm'].map(actual.feature('width'))
```

### `actual.as(unit)`
- Create a partial function that gets a given feature in <var>unit</var>
- <b>@return</b> function

```js
['width', 'height', 'device-width', 'device-height'].map(actual.as('px'))
```

## Compatibility

- Chrome 9+, FF6+, IE9+, Opera 12.1, Safari 5.1 or elsewhere via [`matchMedia`](https://developer.mozilla.org/en-US/docs/Web/API/Window.matchMedia#Browser_compatibility) or `msMatchMedia`
- Results depend on browser `@media` support for the feature in question

## [NPM](//npmjs.org/package/actual)

```sh
$ npm install actual
```

## Contribute

Contribute by making edits in [`/src`](./src) or reporting [issues](../../issues).

```sh
$ npm install
$ grunt jshint:src
```

## Fund

<b>[Tip the developer](https://www.gittip.com/ryanve/)</b> =)

## License

[MIT](LICENSE.md)<commit_msg>actual() returns the breakpoint number<commit_after># [actual](../../)

#### Determine actual `@media` breakpoints for [CSS <b>range</b> features](http://dev.w3.org/csswg/mediaqueries4/#media-descriptor-table)

- <b>actual</b> calculates responsive breakpoints that <em>accurately</em> match CSS media queries
- <b>actual</b> is based on [this gist](https://gist.github.com/ryanve/7924792)

## API ([0.2](../../releases))

### `actual(feature, unit?, init?, step?)`

- <var>feature</var>: [CSS range feature name](http://dev.w3.org/csswg/mediaqueries4/#media-descriptor-table)
- <var>unit</var>: applicable CSS unit (default: unitless)
- <var>init</var>: initial guess (default: `1`)
- <var>step</var>: step size (default: varies by unit)
- <b>@return</b> number (breakpoint)

```js
actual('width', 'em') // => 87.40625
actual('device-width', 'px') // => 1440
actual('resolution', 'dpi') // => 96
actual('color') // => 10
```

### `actual.mq(query)`
- Test if a media query is active
- <b>@return</b> boolean

```js
actual.mq('tv')
actual.mq('(width:30em)')
```

### `actual.feature(feature)`
- Create a partial function that gets <var>feature</var> in a given unit
- <b>@return</b> function

```js
['px', 'em', 'pt', 'in', 'cm', 'mm'].map(actual.feature('width'))
```

### `actual.as(unit)`
- Create a partial function that gets a given feature in <var>unit</var>
- <b>@return</b> function

```js
['width', 'height', 'device-width', 'device-height'].map(actual.as('px'))
```

## Compatibility

- Chrome 9+, FF6+, IE9+, Opera 12.1, Safari 5.1 or elsewhere via [`matchMedia`](https://developer.mozilla.org/en-US/docs/Web/API/Window.matchMedia#Browser_compatibility) or `msMatchMedia`
- Results depend on browser `@media` support for the feature in question

## [NPM](//npmjs.org/package/actual)

```sh
$ npm install actual
```

## Contribute

Contribute by making edits in [`/src`](./src) or reporting [issues](../../issues).

```sh
$ npm install
$ grunt jshint:src
```

## Fund

<b>[Tip the developer](https://www.gittip.com/ryanve/)</b> =)

## License

[MIT](LICENSE.md)
{'fraction_non_alphanumeric': 0.21780528445608188, 'fraction_numerical': 0.018567007855272554, 'mean_word_length': 3.955188679245283, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 69, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '433766', 'n_tokens_mistral': 1633, 'n_tokens_neox': 1460, 'n_words': 350}