Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cofob/postcss-ipfs


https://github.com/cofob/postcss-ipfs

Last synced: about 22 hours ago
JSON representation

Awesome Lists containing this project

README

        

# PostCSS IPFS [PostCSS][PostCSS]

[PostCSS] plugin for replacing IPFS strings.

**Write this:**

```css
.foo {
background-image: url(ipfs://Qmhash/path/to/file.png);
}

.bar {
background-image: url(ipns://some.ipns.link/path/to/file.png);
}
```

**And get this:**

```css
.foo {
background-image: url(https://ipfs.io/ipfs/Qmhash/path/to/file.png);
}

.bar {
background-image: url(https://ipfs.io/ipns/some.ipns.link/path/to/file.png);
}
```

## Installation

`$ npm install postcss-ipfs`

## Usage

```JS
postcss([ require('postcss-ipfs') ])
```

See [PostCSS](https://github.com/postcss/postcss) docs for [examples regarding usage](https://github.com/postcss/postcss#usage).

## Options

### `gateway`

- Type: `string`
- Default: `https://ipfs.io/`

Gateway that will replace `ipfs://` links.

[PostCSS]: https://github.com/postcss/postcss