Read a CSS property value directly from an element's raw inline style
attribute, bypassing the CSSOM (e.g. element.style.fontFamily) which
canonicalizes values and can change formatting. The original format is
preserved (quotes, hex vs rgb, etc.).
When a property is declared more than once, the last declaration wins —
this matches CSS cascade order and is useful when nested spans are merged
and the child's value should take priority.
Property name comparison is case-insensitive.
Parameters
element: HTMLElement
The element whose style attribute should be read.
propertyName: string
The CSS property name (e.g. font-family).
Returns string|null
The raw value string, or null if the property is not present.
Read a CSS property value directly from an element's raw inline
styleattribute, bypassing the CSSOM (e.g.element.style.fontFamily) which canonicalizes values and can change formatting. The original format is preserved (quotes, hex vs rgb, etc.).When a property is declared more than once, the last declaration wins — this matches CSS cascade order and is useful when nested spans are merged and the child's value should take priority.
Property name comparison is case-insensitive.