MCPcopy
hub / github.com/dataarts/dat.gui / cssValueToPixels

Function cssValueToPixels

src/dat/dom/dom.js:31–45  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

29const CSS_VALUE_PIXELS = /(\d+(\.\d+)?)px/;
30
31function cssValueToPixels(val) {
32 if (val === '0' || common.isUndefined(val)) {
33 return 0;
34 }
35
36 const match = val.match(CSS_VALUE_PIXELS);
37
38 if (!common.isNull(match)) {
39 return parseFloat(match[1]);
40 }
41
42 // TODO ...ems? %?
43
44 return 0;
45}
46
47/**
48 * @namespace

Callers 1

dom.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…