# postcss-global-nested

> Wrap styles into :global like postcss-nested does it but for unstandard :global selector

Latest version **1.2.0** (published 2017-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-global-nested
pnpm add postcss-global-nested
yarn add postcss-global-nested
bun add postcss-global-nested
```

## 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 | 1.2.0 |
| Published | 2017-11-19 |
| First published | 2017-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | alex |
| Maintainers | invntrm |

## Links

- npm: https://www.npmjs.com/package/postcss-global-nested
- Repository: https://github.com/a-x-/postcss-global-nested
- Homepage: https://github.com/a-x-/postcss-global-nested#readme
- Issues: https://github.com/a-x-/postcss-global-nested/issues
- npm.io page: https://npm.io/package/postcss-global-nested

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^6.0.9

## Recent versions

- 1.2.0 (latest) — 2017-11-19
- 1.1.2 — 2017-08-25
- 1.1.1 — 2017-08-24
- 1.1.0 — 2017-08-24
- 1.0.0 — 2017-08-24

## README

# postcss-global-nested [![Build Status](https://travis-ci.org/a-x-/postcss-global-nested.svg?branch=master)](https://travis-ci.org/a-x-/postcss-global-nested)

Wrap styles into a `:global` like [postcss-nested](https://github.com/postcss/postcss-nested) does it for usual selectors.

You should use `:global` as rare as you can.

## usage

test.css:
```css
:global {
  .foo {}
  .bar {}
}
```

### Use it with `postcss`, `postcss-nested` and `webpack`
```json5
{
  loader: 'postcss-loader',
  options: {
    plugins: [
      require('autoprefixer')({
        browsers: ['last 2 version'],
      }),
      require('postcss-nested')({}),
      require('postcss-global-nested')({}),
    ],
  },
}
```

### Use it w/ vanilla `postcss` and `postcss-nested`
```js
import pcss from 'postcss';
import nested from 'postcss-nested';
import globalNested from 'postcss-global-nested';

(async () => {
  const css = await util.promisify(fs.readFile)('test.css', 'utf8');
  const result = await pcss([nested, globalNested]).process(css);
  result.css // -> ':global(.foo) {} :global(.bar) {}'
 })();
```

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