# ember-cli-autoprefixer

> Process styles in an ember-cli application using Autoprefixer

Latest version **2.0.0** (published 2021-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-cli-autoprefixer
pnpm add ember-cli-autoprefixer
yarn add ember-cli-autoprefixer
bun add ember-cli-autoprefixer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-11-09 |
| First published | 2014-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 12.* \|\| 14.* \|\| >= 16 |
| Dependencies | 2 |
| Unpacked size | 17 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 103 |
| Author | Kim Røen |
| Maintainers | kimroen, snewcomer |
| Keywords | ember-addon, autoprefixer, css, prefix, preprocess |

## Links

- npm: https://www.npmjs.com/package/ember-cli-autoprefixer
- Repository: https://github.com/kimroen/ember-cli-autoprefixer
- Issues: https://github.com/kimroen/ember-cli-autoprefixer/issues
- npm.io page: https://npm.io/package/ember-cli-autoprefixer

## Dependencies (2)

- [ember-cli-htmlbars](https://npm.io/package/ember-cli-htmlbars.md) ^5.0.0
- [broccoli-autoprefixer](https://npm.io/package/broccoli-autoprefixer.md) ^9.0.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-11-09
- 1.0.3 — 2020-10-27
- 1.0.2 — 2020-05-28
- 1.0.1 — 2020-05-26
- 1.0.0 — 2020-02-17
- 1.0.0-beta.0 — 2020-02-14
- 0.8.1 — 2017-09-19
- 0.8.0 — 2017-08-26
- 0.7.0 — 2017-04-22
- 0.6.0 — 2016-02-21
- 0.5.0 — 2015-09-05
- 0.4.1 — 2015-06-02
- 0.4.0 — 2015-05-31
- 0.3.0 — 2015-01-31
- 0.2.0 — 2014-11-22
- … 4 more at https://npm.io/package/ember-cli-autoprefixer/versions

## README

# Autoprefixer for Ember CLI [![Build Status](https://travis-ci.org/kimroen/ember-cli-autoprefixer.svg?branch=master)](https://travis-ci.org/kimroen/ember-cli-autoprefixer)
This addon runs the styles of your Ember CLI-project through
Autoprefixer.

## Install
To install, run

```
ember install ember-cli-autoprefixer
```

## Options
This addon first consumes your browser list config from `config/targets.js`.  This is the browser list for Babel.

You can manually configure what browsers to target for autoprefixer only.  Add the target browsers to your package.json
as per https://github.com/browserslist/browserslist#readme, add a `.browserslistrc` file, or configure `overrideBrowsersList`
in `ember-cli-build.js`.

```js
// ember-cli-build.js
var app = new EmberApp(defaults, {
  autoprefixer: {
    overrideBrowserslist: ['IE11'],
    cascade: false
  }
});
```

This would prefix styles as required by the two latest version of ios, and disable the cascade (see below).

You can disable Autoprefixer by passing in `enabled: false`.

Other options would also go here along with `overrideBrowserslist`, `enabled` and `cascade`.

You can read more about these settings and others [over on the Autoprefixer page](https://github.com/postcss/autoprefixer#options).

## Note on using with ember-cli-sass

Autoprefixer doesn't play well with `.css.map` files, but it will work with embedded source maps. This means there are two options.

If you want to disable CSS sourcemaps from ember-cli-sass update `ember-cli-build.js` to

```js
  sassOptions: {
    // This tells ember-cli-sass to avoid generating the sourcemap file (like vendor.css.map)
    sourceMap: false
  }
```

Alternatively, you may use embedded source maps.  So we tell `ember-cli-sass` to embed the sourcemaps and then turn on sourcemaps with autoprefixer which will update the embedded sourcemap after adding prefixes.

```js
  sassOptions: {
    sourceMap: true,
    sourceMapEmbed: true
  },
  autoprefixer: {
    enabled: true,
    cascade: true,
    sourcemap: true
  }
```

Also note you can optionally disable in production!

```js
  const envIsProduction = (process.env.EMBER_ENV === 'production');

  ...

  sassOptions: {
    sourceMap: !envIsProduction,
    sourceMapEmbed: !envIsProduction
  },
  autoprefixer: {
    enabled: true,
    cascade: true,
    sourcemap: !envIsProduction
  }
```

## References
- [Autoprefixer](https://github.com/postcss/autoprefixer)
- [broccoli-autoprefixer](https://github.com/sindresorhus/broccoli-autoprefixer)

---
_Source: https://npm.io/package/ember-cli-autoprefixer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
