# extendify/3.2.2/src/Agent/lib/computed-styles.js

Extendify, version 3.2.2. 42 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.2/code/src/Agent/lib/computed-styles.js
- Raw: https://pluginprobe.com/plugins/extendify/3.2.2/raw/src/Agent/lib/computed-styles.js
- Modified: 2026-10-01T15:30:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.2.2/code/src/Agent/lib/computed-styles.js#L10-L20`.

```javascript
// The baseline for relative requests — attributes alone make an unstyled h1 look
// size-less, so "larger" snaps below the theme default.
const ALLOWLIST = [
	'fontSize',
	'lineHeight',
	'fontWeight',
	'fontFamily',
	'fontStyle',
	'letterSpacing',
	'textTransform',
	'textDecoration',
	'color',
	'backgroundColor',
	'borderRadius',
	'borderWidth',
	'borderStyle',
	'borderColor',
	'boxShadow',
	'padding',
	'margin',
	'minHeight',
];

// Every block computes a min-height; only a set one is a size to step from.
const isEmptyValue = (value, prop) =>
	!value ||
	value === 'normal' ||
	value === 'none' ||
	value === 'auto' ||
	(prop === 'minHeight' && value === '0px');

export const readComputedStyles = (el) => {
	if (!el?.ownerDocument?.defaultView) return null;
	const cs = el.ownerDocument.defaultView.getComputedStyle(el);
	const out = {};
	for (const prop of ALLOWLIST) {
		const value = cs[prop];
		if (!isEmptyValue(value, prop)) out[prop] = value;
	}
	return Object.keys(out).length ? out : null;
};

```
