to-px

WebJar for to-px

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

to-px
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

to-px
WebJar for to-px
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/mikolalysenko/to-px

Скачать to-px

Имя Файла Размер
to-px-1.1.0.pom
to-px-1.1.0.jar 6 KB
to-px-1.1.0-sources.jar 22 bytes
to-px-1.1.0-javadoc.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/to-px/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>to-px</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/to-px/
implementation 'org.webjars.npm:to-px:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/to-px/
implementation ("org.webjars.npm:to-px:1.1.0")
'org.webjars.npm:to-px:jar:1.1.0'
<dependency org="org.webjars.npm" name="to-px" rev="1.1.0">
  <artifact name="to-px" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='to-px', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "to-px" % "1.1.0"
[org.webjars.npm/to-px "1.1.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.npm : parse-unit jar [1.0.1,2)

Модули Проекта

Данный проект не имеет модулей.

to-px

Get the scale factor to convert any CSS unit to px (logical pixel units).

testling badge

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.

  • unit is a CSS unit type or a number followed by CSS unit, eg vh or 2in
  • element is an optional element in which the unit is computed (default is document.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

Версии библиотеки

Версия
1.1.0
1.0.1