Socket
Socket
Sign inDemoInstall

postcss-reduce-idents

Package Overview
Dependencies
2
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

4

CHANGELOG.md

@@ -0,3 +1,7 @@

# 1.0.1
* Documentation/metadata tweaks for plugin guidelines compatibility.
# 1.0.0
* Initial release.

4

package.json
{
"name": "postcss-reduce-idents",
"version": "1.0.0",
"version": "1.0.1",
"description": "Reduce custom identifiers with PostCSS.",

@@ -12,3 +12,3 @@ "main": "index.js",

"postcss",
"postcss-plugins"
"postcss-plugin"
],

@@ -15,0 +15,0 @@ "license": "MIT",

@@ -15,11 +15,4 @@ # [postcss][postcss]-reduce-idents [![Build Status](https://travis-ci.org/ben-eb/postcss-reduce-idents.svg?branch=master)][ci] [![NPM version](https://badge.fury.io/js/postcss-reduce-idents.svg)][npm] [![Dependency Status](https://gemnasium.com/ben-eb/postcss-reduce-idents.svg)][deps]

```js
var postcss = require('postcss');
### Input
var css = '@keyframes whiteToBlack{0%{color:#fff}to{color:#000}}.one{animation-name:whiteToBlack}';
console.log(postcss([ require('postcss-reduce-idents') ]).process(css).css);
// => '@keyframes a{0%{color:#fff}to{color:#000}}.one{animation-name:a}'
```
This module will rename custom identifiers in your CSS files; it does so by

@@ -32,2 +25,34 @@ converting each name to a index, which is then encoded into a legal identifier.

```css
@keyframes whiteToBlack {
0% {
color: #fff
}
to {
color: #000
}
}
.one {
animation-name: whiteToBlack
}
```
### Output
```css
@keyframes a {
0% {
color: #fff
}
to {
color: #000
}
}
.one {
animation-name: a
}
```
Note that this module does not handle identifiers that are not linked together.

@@ -48,5 +73,10 @@ The following example will not be transformed in any way:

It works for `@keyframes`, `@counter-style` and custom `counter` values. See the
[documentation][ident] for more information, or the [tests][test.js] for more
[documentation][idents] for more information, or the [tests](test.js) for more
examples.
## Usage
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
examples for your environment.
## Contributing

@@ -63,4 +93,4 @@

[deps]: https://gemnasium.com/ben-eb/postcss-reduce-idents
[ident]: https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident
[idents]: https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident
[npm]: http://badge.fury.io/js/postcss-reduce-idents
[postcss]: https://github.com/postcss/postcss
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc