Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
postcss-reduce-idents
Advanced tools
Readme
Reduce custom identifiers with PostCSS.
With npm do:
npm install postcss-reduce-idents --save
This module will rename custom identifiers in your CSS files; it does so by converting each name to a index, which is then encoded into a legal identifier. A legal custom identifier in CSS is case sensitive and must start with a letter, but can contain digits, hyphens and underscores. There are over 3,000 possible two character identifiers, and 51 possible single character identifiers that will be generated.
@keyframes whiteToBlack {
0% {
color: #fff
}
to {
color: #000
}
}
.one {
animation-name: whiteToBlack
}
@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. The following example will not be transformed in any way:
@keyframes fadeOut {
0% { opacity: 1 }
to { opacity: 0 }
}
.fadeIn {
animation-name: fadeIn;
}
It works for @keyframes
, @counter-style
, custom counter
values and grid area definitions. See the
documentation for more information, or the tests for more
examples.
See the PostCSS documentation for examples for your environment.
Type: boolean
Default: true
Pass false
to disable reducing content
, counter-reset
and counter-increment
declarations.
Type: boolean
Default: true
Pass false
to disable reducing keyframes
rules and animation
declarations.
Type: boolean
Default: true
Pass false
to disable reducing counter-style
rules and list-style
and system
declarations.
Type: boolean
Default: true
Pass false
to disable reducing grid-template
, grid-area
and grid-template-areas
declarations.
Type: function
Default: lib/encode.js
Pass a custom function to encode the identifier with (e.g.: as a way of prefixing them automatically).
It receives two parameters:
String
with the node value.Number
identifying the index of the occurrence.See CONTRIBUTORS.md.
MIT © Ben Briggs
FAQs
Reduce custom identifiers with PostCSS.
We found that postcss-reduce-idents demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).