source: imaps-frontend/node_modules/nano-css/addon/units.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 496 bytes
RevLine 
[d565449]1'use strict';
2
3var units = {};
4var unitList = 'px,cm,mm,in,pt,pc,em,ex,ch,rem,vw,vh,deg,vmin,vmax'.split(',');
5
6function f (unit, val) {
7 return val + unit;
8}
9
10for (var i = 0; i < unitList.length; i++) {
11 var unit = unitList[i];
12
13 units[unit] = f.bind(null, unit);
14}
15
16units.inch = function (val) {
17 return val + 'in';
18};
19
20units.pct = function (val) {
21 return val + '%';
22};
23
24exports.addon = function (renderer) {
25 renderer.assign(renderer, units);
26 renderer.units = units;
27};
Note: See TracBrowser for help on using the repository browser.