MCPcopy Create free account
hub / github.com/cuth/postcss-pxtorem / Declaration

Function Declaration

index.js:151–171  ·  view source on GitHub ↗
(decl)

Source from the content-addressed store, hash-verified

149 );
150 },
151 Declaration(decl) {
152 if (isExcludeFile) return;
153
154 if (
155 decl.value.indexOf("px") === -1 ||
156 !satisfyPropList(decl.prop) ||
157 blacklistedSelector(opts.selectorBlackList, decl.parent.selector)
158 )
159 return;
160
161 const value = decl.value.replace(pxRegex, pxReplace);
162
163 // if rem unit already exists, do not add or replace
164 if (declarationExists(decl.parent, decl.prop, value)) return;
165
166 if (opts.replace) {
167 decl.value = value;
168 } else {
169 decl.cloneAfter({ value: value });
170 }
171 },
172 AtRule(atRule) {
173 if (isExcludeFile) return;
174

Callers

nothing calls this directly

Calls 2

blacklistedSelectorFunction · 0.85
declarationExistsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…