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

Extendify, version 3.2.1. 36 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.1/code/src/Agent/lib/computed-styles.js
- Raw: https://pluginprobe.com/plugins/extendify/3.2.1/raw/src/Agent/lib/computed-styles.js
- Modified: 2026-08-12T16:23:58+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.1/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',
];

const isEmptyValue = (value) =>
	!value || value === 'normal' || value === 'none' || value === 'auto';

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)) out[prop] = value;
	}
	return Object.keys(out).length ? out : null;
};

```
