MCPcopy
hub / github.com/cssinjs/jss / defaultUnit

Function defaultUnit

packages/jss-plugin-default-unit/src/index.js:57–75  ·  view source on GitHub ↗
(options = {})

Source from the content-addressed store, hash-verified

55 * Add unit to numeric values.
56 */
57export default function defaultUnit(options = {}) {
58 const camelCasedOptions = addCamelCasedVersion(options)
59
60 function onProcessStyle(style, rule) {
61 if (rule.type !== 'style') return style
62
63 for (const prop in style) {
64 style[prop] = iterate(prop, style[prop], camelCasedOptions)
65 }
66
67 return style
68 }
69
70 function onChangeValue(value, prop) {
71 return iterate(prop, value, camelCasedOptions)
72 }
73
74 return {onProcessStyle, onChangeValue}
75}

Callers 3

index.test.jsFile · 0.85
createFunction · 0.85
jss.jsFile · 0.85

Calls 1

addCamelCasedVersionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…