To Px
Convert any CSS unit to logical pixels (aka "px")
Install / Use
npx skills add mikolalysenko/to-pxInstalls into whichever agent you are using.
README
to-px
Get the scale factor to convert any CSS unit to px (logical pixel units).
Example
var toPX = require('to-px')
console.log(toPX('1em'))
console.log(toPX('.23vh'))
console.log(toPX('in'))
Install
Note that this module only works within the DOM.
npm i to-px
API
var scaleFactor = require('to-px')(unit[, element])
Computes the number of pixels in the unit string.
unitis a CSS unit type or a number followed by CSS unit, egvhor2inelementis an optional element in which the unit is computed (default isdocument.body)
Returns The number of pixels in the unit
Note Conversions for % are not supported since they are context dependent.
License
(c) 2015 Mikola Lysenko. MIT License
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.7kCommit, push, and open a PR

