Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/hamlim/postcss-plugin-initial

PostCSS plugin to fallback initial keyword
https://github.com/hamlim/postcss-plugin-initial

css postcss postcss-plugins

Last synced: 18 days ago
JSON representation

PostCSS plugin to fallback initial keyword

Awesome Lists containing this project

README

        

# PostCSS Plugin Initial

PostCSS plugin to fallback `initial` keyword.

## Installation

```
yarn add postcss-plugin-initial # or npm install postcss-plugin-initial
```

## Example

```css
a {
animation: initial;
background: initial;
white-space: initial;
}
p {
background: url(/img1.png), url(/img2.png);
background-repeat: initial no-repeat;
}
```

```css
a {
animation: none 0s ease 0s 1 normal none running;
animation: initial;
background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;
background: initial;
white-space: normal;
white-space: initial;
}
p {
background: url(/img1.png), url(/img2.png);
background-repeat: repeat no-repeat;
}
```

## Options

### replace

Takes `boolean`.
Replace the `initial` with the fallback instead of adding it.
Default value: `false`.

### skipSupports

Takes `boolean`.
Doesn't change `initial` values when used within an `@supports` ruleset and the supports check includes the `initial` keyword:

```css
@supports (display: initial) {
.class {
/* Skipped if `skipSupports` is true */
background-color: initial;
}
}
```

Default value: `true`.

## Usage

```js
postcss([
require('postcss-plugin-initial')({
replace: true,
}),
])
```

## [Changelog](./CHANGELOG.md)