Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
convert-css-length
Advanced tools
Convert between css lengths e.g. em->px or px->rem
Conversions between em, ex, rem, px are supported. PRs welcome if you need support for more esoteric length units.
[Note: algorithm was originally ported from Compass] (https://github.com/Compass/compass/blob/master/core/stylesheets/compass/typography/_units.scss)
npm install convert-css-length
import convertLength from 'convert-css-length';
// Set the baseFontSize for your project. Defaults to 16px (also the
// browser default).
var convert = convertLength('21px');
// Convert rem to px.
convert('1rem', 'px');
// ---> 21px
// Convert px to em.
convert('30px', 'em');
// ---> 1.42857em
// Convert em to pixels using fromContext.
// em(s) are relative to the font-size at the same element. If you're setting an em on a element whose font-size
// is different than the base font size, you'll need to pass that font-size as the third parameter.
// Or just use rem instead which sizes everything relative to the base node.
convert('1em', 'px', '14px')
// ---> 14px
FAQs
Convert between css lengths e.g. em->px or px->rem
We found that convert-css-length 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.