
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
postcss-percentage
Advanced tools
PostCSS plugin to support
percentage()function.
This plugin will transform all percentage(expression) functions to correct percentage.
It's almost the same as sass function percentage,
except for the support for the unit (percentage(50px / 50px)).
npm i --save postcss-percentage
postcss([ require('postcss-percentage')(opts) ])
If the input is
.box {
width: percentage(1 / 24);
margin: percentage(- 1 / 24) percentage(0.01 * 5);
}
Then you will get
.box {
width: 4.166667%;
margin: -4.166667% 5%;
}
See PostCSS docs for examples for your environment.
require('postcss-percentage')({
precision: 9,
trimTrailingZero: true,
floor: true
})
precision (default: 6)Allow you to definine the precision for decimal numbers.
Note: allowed value for precision is between [0, 20].
trimTrailingZero (default: true)Allow you to trim trailing zeroes.
When computed value is 1.234000%, we will get 1.234% instead.
floor (default: false)Allow you to ensure the percentage will not greater than the original value. It will be quite useful to ensure the total value won't be greater than 100% (sum of some percentages).
For example, when floor is true and precision is 3, the percentage(1/24)
will get 4.166% rather than 4.167%.
FAQs
PostCSS plugin to support percentage() function
We found that postcss-percentage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.